A delete operation is defined by a DELETE clause. The value of the DELETE is optional. If a value is provided it is the maximum number of root nodes to be deleted. WHERE and FILTER clauses are used to indicate which nodes should be deleted.
An delete can replace a root node or branches. If the WHERE clause matches a branch that branch is deleted along with all attached branches.
Statements are evaluated asynchronously allowing multiple outstanding queries to be active. To support this an RID clause is allowed in the DELETE statement. The value for the RID clause must be a string. The RID value is passed back in the query result.
The return from a DELETE is a JSON Object. The contents of the result Object will be different depending on the success or failure of the evaluation. In all cases a code member will be present. A code value of zero indicates success. Any other value indicates an error.
On success the JSON object result will include a deleted member that is an array of the references to all te deleted records.
If an RID was specified in the query then a rid member will also be included in the result Object.
If an error occurs during statement processing or the statement is not valid the JSON object result will include a error member describing the error.