Oihana PHP Arango

parseCollection.php

Table of Contents

Functions

parseCollection()  : string|null
Returns the collection name portion of an ArangoDB document handle (`<collection>/<key>`).

Functions

parseCollection()

Returns the collection name portion of an ArangoDB document handle (`<collection>/<key>`).

parseCollection(string|null $id) : string|null

PHP mirror of the AQL function PARSE_COLLECTION. Returns null when the input has no / separator (a bare _key is not a valid handle and has no collection to extract).

Parameters
$id : string|null

The full document handle (e.g. "users/abc123").

Tags
example
parseCollection( 'users/abc123' ) ; // 'users'
parseCollection( 'roles/42' )     ; // 'roles'
parseCollection( 'just-a-key' )   ; // null (no separator)
parseCollection( null )           ; // null
parseCollection( '' )             ; // null
see
parseIdentifier()

Returns the full {collection, key} pair.

parseKey()

Returns just the _key portion.

https://docs.arango.ai/arangodb/stable/aql/functions/document-object/#parse_collection
author

Marc Alcaraz

Return values
string|null

The collection name, or null when $id is null / empty / has no /.

On this page

Search results