ArangoDB#
Links#
AQL Examples#
Query all documents from a collection:#
also see FOR (v3.11)
FOR doc IN collection
RETURN doc
Filter documents from a collection:#
also see FILTER (v3.11)
FOR doc IN collection
FILTER doc.name == "Philip"
RETURN doc
Filter documents without surname
attribute name from a collection:#
also see HAS (v3.11)
FOR doc IN collection
FILTER HAS(doc, "surname")
RETURN doc
Query at most 10 documents from a collection:#
also see LIMIT (v3.11)
FOR doc IN collection
LIMIT 10
RETURN doc
Filter and count documents from a collection:#
also see COLLECT (v3.11)
also see COLLECT WITH COUNT (v3.11)
FOR doc IN collection
FILTER doc.name == "Philip"
COLLECT WITH COUNT INTO length
RETURN length
Group and Count#
group by attribute and count
also see COLLECT (v3.11)
FOR doc IN collection
COLLECT attribute = doc.attribute WITH COUNT INTO count
RETURN {
"attribute" : attribute,
"count" : count
}
Delete Attribute#
also see UPDATE (v3.11)
FOR doc IN collection
UPDATE doc WITH { not_needed: null } IN collection
OPTIONS { keepNull: false }