Oihana PHP Arango

renameFieldQuery.php

Table of Contents

Functions

renameFieldQuery()  : string
Builds the AQL that renames a top-level attribute on every document of a collection — the `up()` of a field rename.

Functions

renameFieldQuery()

Builds the AQL that renames a top-level attribute on every document of a collection — the `up()` of a field rename.

renameFieldQuery(string $collection, string $from, string $to) : string

Emits FOR doc IN <collection> FILTER HAS(doc, "<from>") UPDATE doc WITH { <to>: doc.<from>, <from>: null } IN <collection> OPTIONS { keepNull: false } — the new attribute takes the old value, the old one is dropped (keepNull: false removes it rather than storing null).

Pure: returns the query string, runs nothing. A Migration executes it (see Migration::renameField()).

Parameters
$collection : string

The collection name.

$from : string

The current attribute name.

$to : string

The new attribute name.

Tags
author

Marc Alcaraz (ekameleon)

since
1.2.0
Return values
string

The ready-to-run AQL query.

On this page

Search results