dropFieldQuery.php
Table of Contents
Functions
- dropFieldQuery() : string
- Builds the AQL that removes a top-level attribute from every document of a collection.
Functions
dropFieldQuery()
Builds the AQL that removes a top-level attribute from every document of a collection.
dropFieldQuery(string $collection, string $field) : string
Emits FOR doc IN <collection> FILTER HAS(doc, "<field>") UPDATE doc WITH { <field>: null } IN <collection> OPTIONS { keepNull: false } —
keepNull: false strips the attribute instead of storing null.
Pure: returns the query string, runs nothing.
Parameters
- $collection : string
-
The collection name.
- $field : string
-
The attribute to remove.
Tags
Return values
string —The ready-to-run AQL query.