Put a record without specifying a set

Hi, I had seen that the set for the key can be String or null at [here][1]. However, when I coded without a set specified…

var key = {ns:"MyTask",set:"",key:k};

or

var key = aerospike.key("MyTask", null, k);

Errors showed up:

ERROR(28525) [put.cc:111] [prepare] - Parsing as_key(C structure) from key object failed
{ code: -2,
  message: 'AEROSPIKE_ERR_PARAM',
  func: null,
  file: '../src/main/client/put.cc',
  line: 112 }

Could anyone help me to solve this problem? I really need a record inserted without under any set. [1]: https://github.com/aerospike/aerospike-client-nodejs/blob/master/docs/aerospike.md#key

Hi Lynn,

You seemed to have found a bug. (I get the same error if I pass “” or null for set.) Unfortunately, I am not aware of any workaround for this but I will definitely pass it along to our engineers and keep you posted.

Thanks! Dash

Hi Lynn,

Thanks for reporting this. Currently there’s a bug in the API which doesn’t seem to handle to case, you have mentioned. However if the key structure is as follows key = { ns: ns_name, key: key_value} Then write works fine.

We will soon fix the case you have mentioned and release it to npm repository. Thanks again for your patience.

Gayathri.K

Really thanks for the reply!

I didn’t think of trying this before.

Maybe you could also give some hint, or modify some statements in your API documentation to prevent users (like me) from misunderstanding :stuck_out_tongue:

Hi Lynn,

We have fixed the issue you were facing and published the fix to npm repository. You can try now, it should be working fine with the latest fix.

Thanks. Gayathri.K