How do I insert a json object that includes a boolean field

I’m trying to insert a record that contains json using aql with the following:

insert into myns.myset (PK, field) VALUES ("mykey", LIST('[{"useful": false}]'));

but when I select it I see

select * from myns.myset where PK = 'mykey'
+---------+--------------------------+
| PK      | field                    |
+---------+--------------------------+
| "mykey" | LIST('[{"useful":NIL}]') |
+---------+--------------------------+

This happens for true or false. Is there a way to fix this?

Seems like an AQL issue. Will investigate further. Meanwhile, you can insert the data using Java client. Here is a Jupyter Notebook code example. I started with no records in my namespace test and keep it simple, I tested with just a top level MAP instead of a LIST containing one MAP item.

Code:

Key myKey = new Key("test", "myset", "mykey"); 
MapPolicy mPolicy = new MapPolicy();
client.operate(null, myKey, 
   MapOperation.put(mPolicy, "field", Value.get("useful"), Value.get(false)));
System.out.println(client.get(null, myKey));

Output:

(gen:1),(exp:457550308),(bins:(field:{useful=false}))

Checked in AQL:

aql> select * from test
select * from test
+-------------------------+
| field                   |
+-------------------------+
| MAP('{"useful":false}') |
+-------------------------+
1 row in set (0.033 secs)

OK

Now insert same from AQL and check output in AQL:

aql> insert into test.myset (PK, field) VALUES ("mykey", MAP('{"useful": false}'))
insert into test.myset (PK, field) VALUES ("mykey", MAP('{"useful": false}'))
OK, 1 record affected.

aql> select * from test
select * from test
+---------+-----------------------+
| PK      | field                 |
+---------+-----------------------+
| "mykey" | MAP('{"useful":NIL}') |
+---------+-----------------------+
1 row in set (0.034 secs)

OK

and output in Java (Jupyter Notebook):

System.out.println(client.get(null, myKey));

(gen:2),(exp:457550410),(bins:(field:{useful=null}))

So, likely an AQL insert issue. Hopefully, you will write your application in one of the client languages like Java. I will follow up on the AQL issue internally.