如何获取aerospike中记录的空值

Ash*_*shu 2 null record aql aerospike

在此处输入图片说明

我正在使用 aerospike。使用 AQL,我插入了一些数据。我想在 aerospike 中获取具有特定字段的记录的空值。我在那个图片中标记图片 一个记录没有名字它的空白区域

pgu*_*pta 5

Aeropsike 是无模式的——每条记录都是自我描述的。任何非空的 bin 都是记录的一部分。任何更新为 null 的 bin 实际上都会从记录中删除。因此,请考虑记录单位而不是带有列的表。您可以从记录中查询特定的 bin,如果未找到,Aeropsike 将返回空值。这是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
Run Code Online (Sandbox Code Playgroud)