Oihana PHP Arango

parseCollection.php

Table of Contents

Functions

parseCollection()  : string
Return the collection name part of a document identifier.

Functions

parseCollection()

Return the collection name part of a document identifier.

parseCollection(string $documentIdentifier) : string

Wraps the ArangoDB AQL function PARSE_COLLECTION(documentIdentifier).

Example AQL usage:

PARSE_COLLECTION("products/123")   // returns "products"
PARSE_COLLECTION(doc._id)          // collection of the current document
Parameters
$documentIdentifier : string

A document handle / _id expression or string literal.

Tags
example
use function oihana\arango\db\functions\documents\parseCollection;

$expr = parseCollection('doc._id');
// Produces: 'PARSE_COLLECTION(doc._id)'
see
https://docs.arangodb.com/stable/aql/functions/document-object/#parse_collection
since
1.1.0
author

Marc Alcaraz

Return values
string

The formatted AQL expression.

On this page

Search results