ArangoDB v3.10 reached End of Life (EOL) and is no longer supported.

This documentation is outdated. Please see the most recent stable version.

High-level AQL operations

High-level operations are the core language constructs of the query language to perform actions like finding and returning data, as well as creating and modifying documents

FOR

The versatile FOR operation can iterate over a collection or View, the elements of an array, or traverse a graph

RETURN

You can use the RETURN operation to produce the result of a query

FILTER

The FILTER operation lets you restrict the results to elements that match arbitrary logical conditions

SEARCH

The SEARCH operation lets you filter Views, accelerated by the underlying indexes

SORT

The SORT operation allows you to specify one or multiple sort criteria and directions to control the order of query results or the elements of arrays

LIMIT

The LIMIT operation allows you to reduce the number of results to at most the specified number and optionally skip results using an offset for pagination

LET

You can use the LET operation to assign an arbitrary value to a variable

COLLECT

The COLLECT operation can group data by one or multiple grouping criteria, retrieve all distinct values, count how often values occur, and calculate statistical properties efficiently

WINDOW

Aggregate adjacent documents or value ranges with a sliding window to calculate running totals, rolling averages, and other statistical properties

REMOVE

You can use the REMOVE operation to delete documents from a collection

UPDATE

The UPDATE operation partially modifies a document with the given attributes, by adding new and updating existing attributes

REPLACE

The REPLACE operation removes all attributes of a document and sets the given attributes, excluding immutable system attributes

INSERT

You can use the INSERT operation to create new documents in a collection

UPSERT

An UPSERT operation either modifies an existing document, or creates a new document if it does not exist

WITH

An AQL query can start with a WITH operation, listing collections that a query implicitly reads from