Search code examples
aerospike

userKey returned in scanAll for Aerospike is null


I am trying to scan an entire set in Aerospike, but in the callback function I am getting key.userKey as null.

I have tried making both writePolicy.sendKey = true and scanPolicy.sendKey = true but all in vain

I have the most recent AS java client version. (3.1.5)

Sample from put function:

            WritePolicy writePolicy = new WritePolicy();
            writePolicy.expiration = ABC;
            writePolicy.timeout = XYZ;
            writePolicy.sendKey = true;

Solution

  • I think you may not have set sendKey = true on your scan policy.

    Here is an example that works.