List Keys : List keys in a ns.set


#1

Question:

We understand that in Aerospike, a “key” consists of a namespace,set,key. And using aql, we can show every records in a ns.set; however it does not show the key of each record. Is there a way to list the keys in a ns.set?

Resolution:

There is a way to list the keys in a ns.set, you can use AS_POLICY_KEY_SEND, If you want keys to be returned when scanning or querying, the keys must be stored on the server. This policy causes a write operation to store the key. Once a key is stored, the server will keep it – there is no need to use this policy on subsequent updates of the record.

More information can be found: http://www.aerospike.com/apidocs/c/db/d65/group__client__policies.html#ggaa9c8a79b2ab9d3812876c3ec5d1d50ecaababc37bcffeb6ac44a51336a28e3ef1