How can I update a list attribute in aql (aerospike)?

Viewed 315

I have an aql table that looks like this:

| id              | range                                                        
+---------------+-----------------------------------------------------
| "testId"       | LIST('[{"start":"1000", "end":"2999"}]') |               
+---------------+-----------------------------------------------------

I've been trying to unsuccessfully update the range using aql.

I tried this command:

insert into dsc.testTable (pk,'range') 
    values ('testId', LIST('[{"start":"500", "end":"1000"}]'))

But no luck. Help?

1 Answers

In your command, replace LIST with JSON.

See my example on namespace test, set demo below:

aql> insert into test.demo (pk,'range') values ('testId', json('[{"start":"500", "end":"1000"}]'))"
OK, 1 record affected.
aql> select * from test.demo where pk='testId'
+-----------------------------------------+
| range                                   |
+-----------------------------------------+
| LIST('[{"start":"500", "end":"1000"}]') |
+-----------------------------------------+
1 row in set (0.001 secs)

OK
Related