These are few queries which I executed and the results. The fourth one throws error.
LET doc = DOCUMENT("sample/xyz")
RETURN doc.t==null
result: True (as key xyz doesn't exist)
RETURN append(null,[1,2,2],true)
result : [1,2] (unique values appended to empty list)
LET doc = DOCUMENT("sample/xyz")
return append(doc.t,[1,2,2])
result : [1,2,2] ([1,2,2] appended to empty list)
LET doc = DOCUMENT("sample/xyz")
RETURN append(doc.t,[1,2,2],True)
throws error whereas doc.t should evaluate to null and result should be [1,2].
The error that I got is here :
Query: Expecting type Array or Object (while executing) (exception location: /var/lib/jenkins/workspace/ArangoDB_Release/arangod/RestHandler/RestCursorHandler.cpp:131)