Oihana PHP Arango

OverwriteMode uses ConstantsTrait

Table of Contents

Constants

CONFLICT  : string = 'conflict'
If a document with the specified _key value exists already, return a unique constraint violation error so that the insert operation fails.
IGNORE  : string = 'ignore'
If f a document with the specified _key value exists already, nothing will be done and no write operation will be carried out. The insert operation will return success in this case.
REPLACE  : string = 'replace'
If a document with the specified _key value exists already, it will be overwritten with the specified document value.
UPDATE  : string = 'update'
If a document with the specified _key value exists already, it will be patched (partially updated) with the specified document value.

Constants

CONFLICT

If a document with the specified _key value exists already, return a unique constraint violation error so that the insert operation fails.

public string CONFLICT = 'conflict'

This is also the default behavior in case the overwrite mode is not set, and the overwrite flag is false or not set either.

IGNORE

If f a document with the specified _key value exists already, nothing will be done and no write operation will be carried out. The insert operation will return success in this case.

public string IGNORE = 'ignore'

This mode does not support returning the old document version. Using RETURN OLD will trigger a parse error, as there will be no old version to return. RETURN NEW will only return the document in case it was inserted. In case the document already existed, RETURN NEW will return null.

REPLACE

If a document with the specified _key value exists already, it will be overwritten with the specified document value.

public string REPLACE = 'replace'

This mode will also be used when no overwrite mode is specified but the overwrite flag is set to true.

UPDATE

If a document with the specified _key value exists already, it will be patched (partially updated) with the specified document value.

public string UPDATE = 'update'
On this page

Search results