ArangoDB provides many options for finding and modifying data. Though there are
several more specialized operation, data-modification AQL queries are the most
general solution in ArangoDB. They allow to find documents using arbitrary filter
criteria, and to modify or remove the documents once found.
Such find-and-modify operations can be executed with multiple queries (one for
the find step, one for the modification step), or with a single query. Putting
both steps into a single query will often save roundtrips between the application
and the database and thus may be preferred over executing the steps separately.
Putting both the find and the modify step into the same query also prevents other
operations from interfering in between and tampering with the underlying data.
Now what if the application not only requires the data to be updated, but also needs
to keep track of which documents were found and modified by a find-and-modify
query? This is often required when an application needs to keep database
data in sync with data in some other datastore (e.g. the filesystem or a remote
service).
The pattern I would dub find-modify-return would be useful for this.