List Append with JSON


#1

Hello,

I’ve just started looking into aerospike as it might be a solution to a problem I am looking at.

I want to be able to do something like this:

OPERATE LIST_APPEND(ListBin, 'JSON[1,2,3]'), MAP_INCREMENT(countBin, 'seq', 1) on test.demo where PK = 'lk1'

Which ends up with the following error:

Error: (-1) Error: Value is invalid JSON: JSON[1]

I can get the json to insert if I used this method:

insert into test.demo (PK, ListLists) values ('ll2', 'JSON[1,2,3]')

But I want my insert and map increment to be atomic or in a transaction. Any guidance will be much appreciated.


#2

It might be a limitation in AQL, but I’m not sure. Do you plan to use a specific client for this? What version(s) are you using?


#3

The client we intend to use is golang, I have not yet tested if this works using that client. I’ll take a look.


#4

Look at the specific client APIs - AQL is just application written in C, running the C client underneath. Aerospike does not understand AQL type syntax - AQL converts what you are typing in AQL syntax into equivalent C Client calls. AQL is only meant for quick testing and may not support all the functionalities what a programming language client such as C, Java or Go may offer.