-DATASET CSV tinysnb

--

-CASE JsonObjectTest
-LOAD_DYNAMIC_EXTENSION json
-STATEMENT MATCH (p:person) RETURN json_object(p.fName, p.ID)
---- 8
{"Alice":0}
{"Bob":2}
{"Carol":3}
{"Dan":5}
{"Elizabeth":7}
{"Farooq":8}
{"Greg":9}
{"Hubert Blaine Wolfeschlegelsteinhausenbergerdorff":10}

-LOG JsonObjectWithNull
-STATEMENT RETURN JSON_OBJECT('KEY1', NULL, 'KEY2', 5)
---- 1
{"KEY1":null,"KEY2":5}

-LOG JsonObjectWithNonStringKey
-STATEMENT RETURN JSON_OBJECT(5, 5)
---- 1
{"5":5}

-LOG UnflatFlatJsonObject
-STATEMENT MATCH (p:person)-[e:knows]->(p1:person) RETURN JSON_OBJECT(p.fName, p.ID, p1.fName, p1.ID)
---- 14
{"Alice":0,"Bob":2}
{"Alice":0,"Carol":3}
{"Alice":0,"Dan":5}
{"Bob":2,"Alice":0}
{"Bob":2,"Carol":3}
{"Bob":2,"Dan":5}
{"Carol":3,"Alice":0}
{"Carol":3,"Bob":2}
{"Carol":3,"Dan":5}
{"Dan":5,"Alice":0}
{"Dan":5,"Bob":2}
{"Dan":5,"Carol":3}
{"Elizabeth":7,"Farooq":8}
{"Elizabeth":7,"Greg":9}

-STATEMENT RETURN typeof(json_object("name","Alicia"));
---- 1
json

-STATEMENT RETURN json_object(NULL, NULL);
---- 1
{}

-STATEMENT RETURN json_object(NULL, NULL, 2, 3, '5', '4');
---- 1
{"2":3,"5":"4"}

-STATEMENT RETURN json_object(NULL, NULL, 2, 3, '5', '4', NULL, NULL);
---- 1
{"2":3,"5":"4"}
