Hi All,
Trying to get a simple CDT to work from aql
insert into insurance.t1 (PK,name,trips) values(17,"No Name", list('[0,1,[2,[3,4],5,6,[7,[8,9]]]]'))
aql> select * from insurance.t1
+-------------+------------------------------------------------+
| name | trips |
+-------------+------------------------------------------------+
| "No Name" | LIST('[0, 1, [2, [3, 4], 5, 6, [7, [8, 9]]]]') |
+-------------+------------------------------------------------+
this works:
OPERATE LIST_APPEND("trips", 4) on insurance.t1 where PK=17
aql> select * from insurance.t1 where name="N Maharaj"
+-------------+---------------------------------------------------+
| name | trips |
+-------------+---------------------------------------------------+
| "No Name" | LIST('[0, 1, [2, [3, 4], 5, 6, [7, [8, 9]]], 4]') |
+-------------+---------------------------------------------------+
1 row in set (0.001 secs)
This doesn’t:
aql> operate list_append('trips', 99, context=[BY_LIST_INDEX(-1)] on insurance.t1 where PK=17
Unsupported command format with token - 'context'
Make sure string values are enclosed in quotes.
Type " aql --help " from console or simply "help" from within the aql-prompt.
Following docs:
https://docs.aerospike.com/docs/guide/cdt-context.html#append-an-item-to-a-list-at-the-last-element
https://docs.aerospike.com/docs/tools/aql/record_operations.html#operate-on-a-record
Does it only work with the APIs?