The record passed to the query callback function does not have the key populated correctly

Hi,

I have only one bin. I do a query on it with aerospike_query_foreach(), my callback function gets called (yeah!) and I see the bin value which I used for the query in the first place (no big surprise here).

However, what I really want is the key value.

I examine rec->key.value.integer.value and it is 0 when in reality it should be 999 (in my trivial test case).

What gives?

P.S.: I use the community edition 5.7.0.8 on Ubuntu 20.04

By default, Aerospike clients don’t send your key to the server. They only send the 20 byte RIPEMD160 hash of your (key+setname+keytype). If, in addition, you want to send “your” key to the server, in client policy, use sendKey=true – (or equiv. depending on which client you are using). Then try the above test…

Thank you, this did the trick.