2017-07-05 9 views

答えて

4

エアロプスケはスキーマレスです - 各レコードは自己記述型です。ヌル以外のビンはレコードの一部です。ヌルに更新されたビンは、実際にレコードから削除されます。だから、列を持つテーブルの代わりにレコードの単位で考える。レコードから特定のビンを問い合わせることができます。見つからなければ、Aeropsikeはnullを返します。ここではJavaのAPIは次のとおりです。

public final Record get(Policy policy, 
     Key key, 
     String... binNames) 
       throws AerospikeException 
Read record header and bins for specified key. The policy can be used to specify timeouts. 
Specified by: 
get in interface IAerospikeClient 
Parameters: 
policy - generic configuration parameters, pass in null for defaults 
key - unique record identifier 
binNames - bins to retrieve 
Returns: 
if found, return record instance. If not found, return null. 
Throws: 
AerospikeException - if read fails 
1

は、いくつかのテストコードを蘭 - レコードキーは、いくつかの他のビンと有効です。

userRecord = client.get(null, userKey, "notThereBin"); 
    if (userRecord != null) { 
     console.printf("\nINFO: User record with notThereBin read successfully! Here are the details:\n"); 
     console.printf("notThereBin: " + userRecord.getValue("notThereBin") + "\n"); 
    } else { 
     console.printf("ERROR: User record not found!\n"); 
    } 

、出力は次のようになります。

INFO: User record with notThereBin read successfully! Here are the details: 

notThereBin: null 
関連する問題