ArangoDB-PHP API Documentation
  • Namespace
  • Class
  • Deprecated

Namespaces

  • triagens
    • ArangoDb

Classes

  • AdminHandler
  • AqlUserFunction
  • Autoloader
  • Batch
  • BatchPart
  • BindVars
  • Collection
  • CollectionHandler
  • Connection
  • ConnectionOptions
  • Cursor
  • Database
  • DefaultValues
  • Document
  • DocumentHandler
  • Edge
  • EdgeDefinition
  • EdgeHandler
  • Endpoint
  • Export
  • ExportCursor
  • Graph
  • GraphHandler
  • Handler
  • HttpHelper
  • HttpResponse
  • QueryCacheHandler
  • QueryHandler
  • Statement
  • TraceRequest
  • TraceResponse
  • Transaction
  • Traversal
  • UpdatePolicy
  • UrlHelper
  • Urls
  • User
  • UserHandler
  • ValueValidator
  • Vertex
  • VertexHandler

Exceptions

  • ClientException
  • ConnectException
  • Exception
  • ServerException

Class CollectionHandler

Provides management of collections

The collection handler fetches collection data from the server and creates collections on the server.

triagens\ArangoDb\Handler
Extended by triagens\ArangoDb\CollectionHandler
Namespace: triagens\ArangoDb
Package: triagens\ArangoDb
Since: 0.2
Located at CollectionHandler.php

Methods summary

public mixed
# create( mixed $collection, array $options = [] )

Creates a new collection on the server

Creates a new collection on the server

This will add the collection on the server and return its id The id is mainly returned for backwards compatibility, but you should use the collection name for any reference to the collection. * This will throw if the collection cannot be created

Parameters

$collection
  • collection object to be created on the server or a string with the name
$options
  • an array of options.

Options are :

  • 'type' - 2 -> normal collection, 3 -> edge-collection
  • 'waitForSync' - if set to true, then all removal operations will instantly be synchronised to disk / If this is not specified, then the collection's default sync behavior will be applied.
  • 'journalSize' - journalSize value.
  • 'isSystem' - false->user collection(default), true->system collection .
  • 'isVolatile' - false->persistent collection(default), true->volatile (in-memory) collection .
  • 'numberOfShards' - number of shards for the collection.
  • 'shardKeys' - list of shard key attributes.
  • Returns

    mixed
    • id of collection created

    Throws

    triagens\ArangoDb\Exception
    public boolean
    # has( mixed $collection )

    Check if a collection exists

    Check if a collection exists

    This will call self::get() internally and checks if there was an exception thrown which represents an 404 request.

    Parameters

    $collection
    • collection id as a string or number

    Returns

    boolean

    Throws

    triagens\ArangoDb\Exception
    When any other error than a 404 occurs
    public integer
    # count( mixed $collection )

    Get the number of documents in a collection

    Get the number of documents in a collection

    This will throw if the collection cannot be fetched from the server

    Parameters

    $collection
    • collection id as a string or number

    Returns

    integer
    • the number of documents in the collection

    Throws

    triagens\ArangoDb\Exception
    public triagens\ArangoDb\Collection
    # get( mixed $collection )

    Get information about a collection

    Get information about a collection

    This will throw if the collection cannot be fetched from the server

    Parameters

    $collection
    • collection id as a string or number

    Returns

    triagens\ArangoDb\Collection
    • the collection fetched from the server

    Throws

    triagens\ArangoDb\Exception
    public triagens\ArangoDb\Collection
    # getProperties( mixed $collection )

    Get properties of a collection

    Get properties of a collection

    This will throw if the collection cannot be fetched from the server

    Parameters

    $collection
    • collection id as a string or number

    Returns

    triagens\ArangoDb\Collection
    • the collection fetched from the server

    Throws

    triagens\ArangoDb\Exception
    public array
    # figures( mixed $collection )

    Get figures for a collection

    Get figures for a collection

    This will throw if the collection cannot be fetched from the server

    Parameters

    $collection
    • collection id as a string or number

    Returns

    array
    • the figures for the collection

    Throws

    triagens\ArangoDb\Exception
    public array
    # getChecksum( mixed $collectionId, boolean $withRevisions = false, boolean $withData = false )

    Calculate a checksum of the collection.

    Calculate a checksum of the collection.

    Will calculate a checksum of the meta-data (keys and optionally revision ids) and optionally the document data in the collection.

    Parameters

    $collectionId
    • collection id as a string or number
    $withRevisions
    • optional boolean whether or not to include document revision ids in the checksum calculation.
    $withData
    • optional boolean whether or not to include document body data in the checksum calculation.

    Returns

    array
    • array containing keys "checksum" and "revision"

    Throws

    triagens\ArangoDb\Exception
    public array
    # getRevision( mixed $collectionId )

    Returns the Collections revision ID

    Returns the Collections revision ID

    The revision id is a server-generated string that clients can use to check whether data in a collection has changed since the last revision check.

    Parameters

    $collectionId
    • collection id as a string or number

    Returns

    array
    • containing a key revision

    Throws

    triagens\ArangoDb\Exception
    public boolean
    # rename( mixed $collection, string $name )

    Rename a collection

    Rename a collection

    Parameters

    $collection
    • collection id as string or number or collection object
    $name
    • new name for collection

    Returns

    boolean
    • always true, will throw if there is an error

    Throws

    triagens\ArangoDb\Exception
    public triagens\ArangoDb\HttpResponse
    # load( mixed $collection )

    Load a collection into the server's memory

    Load a collection into the server's memory

    This will load the given collection into the server's memory.

    Parameters

    $collection
    • collection id as string or number or collection object

    Returns

    triagens\ArangoDb\HttpResponse
    • HTTP response object

    Throws

    triagens\ArangoDb\Exception
    public triagens\ArangoDb\HttpResponse
    # unload( mixed $collection )

    Unload a collection from the server's memory

    Unload a collection from the server's memory

    This will unload the given collection from the server's memory.

    Parameters

    $collection
    • collection id as string or number or collection object

    Returns

    triagens\ArangoDb\HttpResponse
    • HTTP response object

    Throws

    triagens\ArangoDb\Exception
    public boolean
    # truncate( mixed $collection )

    Truncate a collection

    Truncate a collection

    This will remove all documents from the collection but will leave the metadata and indexes intact.

    Parameters

    $collection
    • collection id as string or number or collection object

    Returns

    boolean
    • always true, will throw if there is an error

    Throws

    triagens\ArangoDb\Exception
    public boolean
    # drop( mixed $collection, array $options = [] )

    Drop a collection

    Drop a collection

    Parameters

    $collection
    • collection id as string or number or collection object
    $options
    • an array of options for the drop operation

    Returns

    boolean
    • always true, will throw if there is an error

    Throws

    triagens\ArangoDb\Exception
    public boolean
    # isValidCollectionId( $collectionId )

    Checks if the collectionId given, is valid. Returns true if it is, or false if it is not.

    Checks if the collectionId given, is valid. Returns true if it is, or false if it is not.

    Parameters

    $collectionId

    Returns

    boolean
    public array
    # getAllCollections( array $options = [] )

    Get list of all available collections per default with the collection names as index. Returns empty array if none are available.

    Get list of all available collections per default with the collection names as index. Returns empty array if none are available.

    Parameters

    $options
    • optional - an array of options.

    Options are :

  • 'excludeSystem' - With a value of true, all system collections will be excluded from the response.
  • 'keys' - With a value of "collections", the index of the resulting array is numerical, With a value of "names", the index of the resulting array are the collection names.
  • Returns

    array

    Throws

    triagens\ArangoDb\Exception
    triagens\ArangoDb\ClientException
    public mixed
    # getCollectionId( mixed $collection )

    Gets the collectionId from the given collectionObject or string/integer

    Gets the collectionId from the given collectionObject or string/integer

    Parameters

    $collection

    Returns

    mixed
    public mixed
    # getCollectionName( mixed $collection )

    Gets the collectionId from the given collectionObject or string/integer

    Gets the collectionId from the given collectionObject or string/integer

    Parameters

    $collection

    Returns

    mixed
    public array
    # importFromFile( mixed $collectionId, mixed $importFileName, array $options = [] )

    Import documents from a file

    Import documents from a file

    This will throw on all errors except insertion errors

    Parameters

    $collectionId
    • collection id as string or number
    $importFileName
    • The filename that holds the import data.
    $options
    • optional - an array of options.

    Options are :
    'type' - if type is not set or it's set to '' or null, the Header-Value format must be provided in the import file.

  • if set to 'documents', then the file's content must have its documents line by line. Each line will be interpreted as a document.
  • if set to 'array' then the file's content must provide the documents as a list of documents instead of the above line by line.

  • More info on how the import functionality works: https://github.com/triAGENS/ArangoDB/wiki/HttpImport


  • 'createCollection' - If true, create the collection if it does not exist. Defaults to false
  • Returns

    array
    • returns an array with the server's response data from the import command

    Throws

    triagens\ArangoDb\Exception
    public array
    # import( $collection, string|array $importData, array $options = [] )

    Import documents into a collection

    Import documents into a collection

    This will throw on all errors except insertion errors

    Parameters

    $collection
    $collection - collection id as string or number
    $importData
    • The data to import. This can be a string holding the data according to the type of import, or an array of documents
    $options
    • optional - an array of options.

    Options are :

  • 'type' - if type is not set or it's set to '' or null, the Header-Value format must be provided in the import file.

  • if set to 'documents', then the file's content must have its documents line by line. Each line will be interpreted as a document.
  • if set to 'array' then the file's content must provide the documents as a list of documents instead of the above line by line.

  • More info on how the import functionality works: https://github.com/triAGENS/ArangoDB/wiki/HttpImport


  • 'createCollection' - If true, create the collection if it does not exist. Defaults to false
  • Returns

    array

    Throws

    triagens\ArangoDb\Exception
    triagens\ArangoDb\ClientException
    public array
    # createHashIndex( string $collectionId, array $fields, boolean $unique = null, boolean $sparse = null )

    Create a hash index

    Create a hash index

    Parameters

    $collectionId
    • the collection id
    $fields
    • an array of fields
    $unique
    • whether the values in the index should be unique or not
    $sparse
    • whether the index should be sparse

    Returns

    array
    • server response of the created index

    Throws

    triagens\ArangoDb\Exception

    Link

    https://docs.arangodb.com/HTTP/Indexes/Hash.html
    public array
    # createFulltextIndex( string $collectionId, array $fields, integer $minLength = null )

    Create a fulltext index

    Create a fulltext index

    Parameters

    $collectionId
    • the collection id
    $fields
    • an array of fields
    $minLength
    • the minimum length of words to index

    Returns

    array
    • server response of the created index

    Throws

    triagens\ArangoDb\Exception

    Link

    https://docs.arangodb.com/HTTP/Indexes/Fulltext.html
    public array
    # createSkipListIndex( string $collectionId, array $fields, boolean $unique = null, boolean $sparse = null )

    Create a skip-list index

    Create a skip-list index

    Parameters

    $collectionId
    • the collection id
    $fields
    • an array of fields
    $unique
    • whether the index is unique or not
    $sparse
    • whether the index should be sparse

    Returns

    array
    • server response of the created index

    Throws

    triagens\ArangoDb\Exception

    Link

    https://docs.arangodb.com/HTTP/Indexes/Skiplist.html
    public array
    # createPersistentIndex( string $collectionId, array $fields, boolean $unique = null, boolean $sparse = null )

    Create a persistent index

    Create a persistent index

    Parameters

    $collectionId
    • the collection id
    $fields
    • an array of fields
    $unique
    • whether the index is unique or not
    $sparse
    • whether the index should be sparse

    Returns

    array
    • server response of the created index

    Throws

    triagens\ArangoDb\Exception

    Link

    https://docs.arangodb.com/HTTP/Indexes/Persistent.html
    public array
    # createGeoIndex( string $collectionId, array $fields, boolean $geoJson = null, boolean $constraint = null, boolean $ignoreNull = null )

    Create a geo index

    Create a geo index

    Parameters

    $collectionId
    • the collection id
    $fields
    • an array of fields
    $geoJson
    • whether to use geoJson or not
    $constraint
    • whether this is a constraint or not
    $ignoreNull
    • whether to ignore null

    Returns

    array
    • server response of the created index

    Throws

    triagens\ArangoDb\Exception

    Link

    https://docs.arangodb.com/HTTP/Indexes/Geo.html
    public array
    # index( mixed $collectionId, string $type = '', array $attributes = [], boolean $unique = false, array $indexOptions = [] )

    Creates an index on a collection on the server

    Creates an index on a collection on the server

    This will create an index on the collection on the server and return its id

    This will throw if the index cannot be created

    Parameters

    $collectionId
    • The id of the collection where the index is to be created
    $type
    • index type: hash, skiplist, geo, fulltext, or persistent
    $attributes
    • an array of attributes that can be defined like array('a') or array('a', 'b.c')
    $unique
    • true/false to create a unique index
    $indexOptions
    • an associative array of options for the index like array('geoJson' => true, 'sparse' => false)

    Returns

    array
    • server response of the created index

    Throws

    triagens\ArangoDb\Exception
    public array
    # getIndex( string $collection, string $indexId )

    Get the information about an index in a collection

    Get the information about an index in a collection

    Parameters

    $collection
    • the id of the collection
    $indexId
    • the id of the index

    Returns

    array

    Throws

    triagens\ArangoDb\Exception
    triagens\ArangoDb\ClientException
    public array
    # getIndexes( mixed $collectionId )

    Get indexes of a collection

    Get indexes of a collection

    This will throw if the collection cannot be fetched from the server

    Parameters

    $collectionId
    • collection id as a string or number

    Returns

    array
    $data - the indexes result-set from the server

    Throws

    triagens\ArangoDb\Exception
    public boolean
    # dropIndex( mixed $indexHandle )

    Drop an index

    Drop an index

    Parameters

    $indexHandle
    • index handle (collection name / index id)

    Returns

    boolean
    • always true, will throw if there is an error

    Throws

    triagens\ArangoDb\Exception
    public triagens\ArangoDb\Document
    # any( mixed $collectionId )

    Get a random document from the collection.

    Get a random document from the collection.

    This will throw if the document cannot be fetched from the server

    Parameters

    $collectionId
    • collection id as string or number

    Returns

    triagens\ArangoDb\Document
    • the document fetched from the server

    Throws

    triagens\ArangoDb\Exception

    Since

    1.2
    public triagens\ArangoDb\Cursor
    # all( mixed $collectionId, array $options = [] )

    Returns all documents of a collection

    Returns all documents of a collection

    Parameters

    $collectionId
    • collection id as string or number
    $options
    • optional array of options.

    Options are :

  • '_sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.
  • '_hiddenAttributes' - Set an array of hidden attributes for created documents.

    This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.
    The difference is, that if you're returning a result set of documents, the getAll() is already called
    and the hidden attributes would not be applied to the attributes.

  • 'batchSize' - can optionally be used to tell the server to limit the number of results to be transferred in one batch
  • 'skip' - Optional, The number of documents to skip in the query.
  • 'limit' - Optional, The maximal amount of documents to return. 'skip' is applied before the limit restriction.
  • Returns

    triagens\ArangoDb\Cursor
    • documents

    Throws

    triagens\ArangoDb\Exception
    triagens\ArangoDb\ClientException
    public array
    # getAllIds( mixed $collection )

    Get the list of all documents' ids from a collection

    Get the list of all documents' ids from a collection

    This will throw if the list cannot be fetched from the server

    Parameters

    $collection
    • collection id as string or number

    Returns

    array
    • ids of documents in the collection

    Throws

    triagens\ArangoDb\Exception
    public cursor
    # byExample( mixed $collectionId, mixed $document, array $options = [] )

    Get document(s) by specifying an example

    Get document(s) by specifying an example

    This will throw if the list cannot be fetched from the server

    Parameters

    $collectionId
    • collection id as string or number
    $document
    • the example document as a Document object or an array
    $options
    • optional, prior to v1.0.0 this was a boolean value for sanitize, since v1.0.0 it's an array of options.

    Options are :

  • '_sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.
  • '_hiddenAttributes' - Set an array of hidden attributes for created documents.

    This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.
    The difference is, that if you're returning a result set of documents, the getAll() is already called
    and the hidden attributes would not be applied to the attributes.

  • 'batchSize' - can optionally be used to tell the server to limit the number of results to be transferred in one batch
  • 'skip' - Optional, The number of documents to skip in the query.
  • 'limit' - Optional, The maximal amount of documents to return. 'skip' is applied before the limit restriction.
  • Returns

    cursor
    • Returns a cursor containing the result

    Throws

    triagens\ArangoDb\Exception
    public triagens\ArangoDb\Document
    # firstExample( mixed $collectionId, mixed $document, array $options = [] )

    Get the first document matching a given example.

    Get the first document matching a given example.

    This will throw if the document cannot be fetched from the server

    Parameters

    $collectionId
    • collection id as string or number
    $document
    • the example document as a Document object or an array
    $options
    • optional, an array of options.

    Options are :

  • '_sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.
  • '_hiddenAttributes' - Set an array of hidden attributes for created documents.

    This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.
    The difference is, that if you're returning a result set of documents, the getAll() is already called
    and the hidden attributes would not be applied to the attributes.

  • Returns

    triagens\ArangoDb\Document
    • the document fetched from the server

    Throws

    triagens\ArangoDb\Exception

    Since

    1.2
    public cursor
    # fulltext( mixed $collection, mixed $attribute, mixed $query, array $options = [] )

    Get document(s) by a fulltext query

    Get document(s) by a fulltext query

    This will find all documents from the collection that match the fulltext query specified in query. In order to use the fulltext operator, a fulltext index must be defined for the collection and the specified attribute.

    Parameters

    $collection
    • collection id as string or number
    $attribute
    • The attribute that contains the texts.
    $query
    • The fulltext query.
    $options
    • optional, prior to v1.0.0 this was a boolean value for sanitize, since v1.0.0 it's an array of options.

    Options are :

  • '_sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.
  • '_hiddenAttributes' - Set an array of hidden attributes for created documents.

    This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.
    The difference is, that if you're returning a result set of documents, the getAll() is already called
    and the hidden attributes would not be applied to the attributes.

  • 'batchSize' - can optionally be used to tell the server to limit the number of results to be transferred in one batch
  • 'skip' - Optional, The number of documents to skip in the query.
  • 'limit' - Optional, The maximal amount of documents to return. 'skip' is applied before the limit restriction.
  • 'index' - If given, the identifier of the fulltext-index to use.
  • Returns

    cursor
    • Returns a cursor containing the result

    Throws

    triagens\ArangoDb\Exception
    public boolean
    # updateByExample( mixed $collectionId, mixed $example, mixed $newValue, array $options = [] )

    Update document(s) matching a given example

    Update document(s) matching a given example

    This will update the document(s) on the server

    This will throw if the document cannot be updated

    Parameters

    $collectionId
    • collection id as string or number
    $example
    • the example document as a Document object or an array
    $newValue
    • patch document or array which contains the attributes and values to be updated
    $options
    • optional, array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method)

    Options are :

  • 'keepNull' - can be used to instruct ArangoDB to delete existing attributes instead setting their values to null. Defaults to true (keep attributes when set to null)
  • 'waitForSync' - can be used to force synchronisation of the document update operation to disk even in case that the waitForSync flag had been disabled for the entire collection
  • 'limit' - can be used set a limit on how many documents to update at most. If limit is specified but is less than the number of documents in the collection, it is undefined which of the documents will be updated.
  • Returns

    boolean
    • always true, will throw if there is an error

    Throws

    triagens\ArangoDb\Exception

    Since

    1.2
    public boolean
    # replaceByExample( mixed $collectionId, mixed $example, mixed $newValue, array $options = [] )

    Replace document(s) matching a given example

    Replace document(s) matching a given example

    This will replace the document(s) on the server

    This will throw if the document cannot be replaced

    Parameters

    $collectionId
    • collection id as string or number
    $example
    • the example document as a Document object or an array
    $newValue
    • patch document or array which contains the attributes and values to be replaced
    $options
    • optional, array of options (see below) or the boolean value for $policy (for compatibility prior to version 1.1 of this method)

    Options are :

  • 'keepNull' - can be used to instruct ArangoDB to delete existing attributes instead setting their values to null. Defaults to true (keep attributes when set to null)
  • 'waitForSync' - can be used to force synchronisation of the document replace operation to disk even in case that the waitForSync flag had been disabled for the entire collection
  • 'limit' - can be used set a limit on how many documents to replace at most. If limit is specified but is less than the number of documents in the collection, it is undefined which of the documents will be replaced.
  • Returns

    boolean
    • always true, will throw if there is an error

    Throws

    triagens\ArangoDb\Exception

    Since

    1.2
    public integer
    # removeByExample( mixed $collectionId, mixed $document, array $options = [] )

    Remove document(s) by specifying an example

    Remove document(s) by specifying an example

    This will throw on any error

    Parameters

    $collectionId
    • collection id as string or number
    $document
    • the example document as a Document object or an array
    $options
    • optional - an array of options.

    Options are :

  • 'waitForSync' - if set to true, then all removal operations will instantly be synchronised to disk.
    If this is not specified, then the collection's default sync behavior will be applied.
  •                             <li>'limit' -  Optional, The maximal amount of documents to return. 'skip' is applied before the limit restriction.</li>
    

    Returns

    integer
    • number of documents that were deleted

    Throws

    triagens\ArangoDb\Exception

    Since

    1.2
    public array
    # removeByKeys( mixed $collectionId, array $keys, array $options = [] )

    Remove document(s) by specifying an array of keys

    Remove document(s) by specifying an array of keys

    This will throw on any error

    Parameters

    $collectionId
    • collection id as string or number
    $keys
    • array of document keys
    $options
    • optional - an array of options.

    Options are :

  • 'waitForSync' - if set to true, then all removal operations will instantly be synchronised to disk.
    If this is not specified, then the collection's default sync behavior will be applied.
  • Returns

    array
    • an array containing an attribute 'removed' with the number of documents that were deleted, an an array 'ignored' with the number of not removed keys/documents

    Throws

    triagens\ArangoDb\Exception

    Since

    2.6
    public array
    # lookupByKeys( mixed $collectionId, array $keys, array $options = [] )

    Bulk lookup documents by specifying an array of keys

    Bulk lookup documents by specifying an array of keys

    This will throw on any error

    Parameters

    $collectionId
    • collection id as string or number
    $keys
    • array of document keys
    $options
    • optional array of options.

    Options are :

  • '_sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.
  • '_hiddenAttributes' - Set an array of hidden attributes for created documents.

  • Returns

    array
    • an array containing all documents found for the keys specified. note that if for a given key not document is found, it will not be returned nor will the document's non-existence be reported.

    Throws

    triagens\ArangoDb\Exception

    Since

    2.6
    public triagens\ArangoDb\Cursor
    # range( mixed $collectionId, string $attribute, mixed $left, mixed $right, array $options = [] )

    Get document(s) by specifying range

    Get document(s) by specifying range

    This will throw if the list cannot be fetched from the server

    Parameters

    $collectionId
    • collection id as string or number
    $attribute
    • the attribute path , like 'a', 'a.b', etc...
    $left
    • The lower bound.
    $right
    • The upper bound.
    $options
    • optional array of options.

    Options are :

  • '_sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.
  • '_hiddenAttributes' - Set an array of hidden attributes for created documents.

    This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.
    The difference is, that if you're returning a result set of documents, the getAll() is already called
    and the hidden attributes would not be applied to the attributes.

  • 'closed' - If true, use interval including left and right, otherwise exclude right, but include left.
  • 'batchSize' - can optionally be used to tell the server to limit the number of results to be transferred in one batch
  • 'skip' - Optional, The number of documents to skip in the query.
  • 'limit' - Optional, The maximal amount of documents to return. 'skip' is applied before the limit restriction.
  • Returns

    triagens\ArangoDb\Cursor
    • documents matching the example [0...n]

    Throws

    triagens\ArangoDb\Exception
    public triagens\ArangoDb\Cursor
    # near( mixed $collectionId, float $latitude, float $longitude, array $options = [] )

    Get document(s) by specifying near

    Get document(s) by specifying near

    This will throw if the list cannot be fetched from the server

    Parameters

    $collectionId
    • collection id as string or number
    $latitude
    • The latitude of the coordinate.
    $longitude
    • The longitude of the coordinate.
    $options
    • optional array of options.

    Options are :

  • '_sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.
  • '_hiddenAttributes' - Set an array of hidden attributes for created documents.

    This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.
    The difference is, that if you're returning a result set of documents, the getAll() is already called
    and the hidden attributes would not be applied to the attributes.

  • 'distance' - If given, the attribute key used to store the distance. (optional)
  • 'batchSize' - can optionally be used to tell the server to limit the number of results to be transferred in one batch
  • 'skip' - Optional, The number of documents to skip in the query.
  • 'limit' - Optional, The maximal amount of documents to return. 'skip' is applied before the limit restriction.
  • Returns

    triagens\ArangoDb\Cursor
    • documents matching the example [0...n]

    Throws

    triagens\ArangoDb\Exception
    public triagens\ArangoDb\Cursor
    # within( mixed $collectionId, float $latitude, float $longitude, integer $radius, array $options = [] )

    Get document(s) by specifying within

    Get document(s) by specifying within

    This will throw if the list cannot be fetched from the server

    Parameters

    $collectionId
    • collection id as string or number
    $latitude
    • The latitude of the coordinate.
    $longitude
    • The longitude of the coordinate.
    $radius
    • The maximal radius (in meters).
    $options
    • optional array of options.

    Options are :

  • '_sanitize' - True to remove _id and _rev attributes from result documents. Defaults to false.
  • '_hiddenAttributes' - Set an array of hidden attributes for created documents.

    This is actually the same as setting hidden attributes using setHiddenAttributes() on a document.
    The difference is, that if you're returning a result set of documents, the getAll() is already called
    and the hidden attributes would not be applied to the attributes.

  • 'distance' - If given, the attribute key used to store the distance. (optional)
  • 'batchSize' - can optionally be used to tell the server to limit the number of results to be transferred in one batch
  • 'skip' - Optional, The number of documents to skip in the query.
  • 'limit' - Optional, The maximal amount of documents to return. 'skip' is applied before the limit restriction.
  • Returns

    triagens\ArangoDb\Cursor
    • documents matching the example [0...n]

    Throws

    triagens\ArangoDb\Exception

    Methods inherited from triagens\ArangoDb\Handler

    __construct(), getConnection(), getConnectionOption(), includeOptionsInBody(), includeOptionsInParams(), json_encode_wrapper(), makeCollection()

    Constants summary

    string ENTRY_DOCUMENTS

    documents array index

    documents array index

    # 'documents'
    string OPTION_COLLECTION

    collection parameter

    collection parameter

    # 'collection'
    string OPTION_EXAMPLE

    example parameter

    example parameter

    # 'example'
    string OPTION_NEW_VALUE

    example parameter

    example parameter

    # 'newValue'
    string OPTION_CREATE_COLLECTION

    example parameter

    example parameter

    # 'createCollection'
    string OPTION_ATTRIBUTE

    attribute parameter

    attribute parameter

    # 'attribute'
    string OPTION_KEYS

    keys parameter

    keys parameter

    # 'keys'
    string OPTION_LEFT

    left parameter

    left parameter

    # 'left'
    string OPTION_RIGHT

    right parameter

    right parameter

    # 'right'
    string OPTION_CLOSED

    closed parameter

    closed parameter

    # 'closed'
    string OPTION_LATITUDE

    latitude parameter

    latitude parameter

    # 'latitude'
    string OPTION_LONGITUDE

    longitude parameter

    longitude parameter

    # 'longitude'
    string OPTION_DISTANCE

    distance parameter

    distance parameter

    # 'distance'
    string OPTION_RADIUS

    radius parameter

    radius parameter

    # 'radius'
    string OPTION_SKIP

    skip parameter

    skip parameter

    # 'skip'
    string OPTION_INDEX

    index parameter

    index parameter

    # 'index'
    string OPTION_LIMIT

    limit parameter

    limit parameter

    # 'limit'
    string OPTION_FIELDS

    fields

    fields

    # 'fields'
    string OPTION_UNIQUE

    unique

    unique

    # 'unique'
    string OPTION_TYPE

    type

    type

    # 'type'
    string OPTION_SIZE

    size option

    size option

    # 'size'
    string OPTION_GEO_INDEX

    geo index option

    geo index option

    # 'geo'
    string OPTION_IGNORE_NULL

    ignoreNull option

    ignoreNull option

    # 'ignoreNull'
    string OPTION_CONSTRAINT

    constraint option

    constraint option

    # 'constraint'
    string OPTION_GEOJSON

    geoJson option

    geoJson option

    # 'geoJson'
    string OPTION_HASH_INDEX

    hash index option

    hash index option

    # 'hash'
    string OPTION_FULLTEXT_INDEX

    fulltext index option

    fulltext index option

    # 'fulltext'
    string OPTION_MIN_LENGTH

    minLength option

    minLength option

    # 'minLength'
    string OPTION_SKIPLIST_INDEX

    skiplist index option

    skiplist index option

    # 'skiplist'
    string OPTION_PERSISTENT_INDEX

    persistent index option

    persistent index option

    # 'persistent'
    string OPTION_SPARSE

    sparse index option

    sparse index option

    # 'sparse'
    string OPTION_COUNT

    count option

    count option

    # 'count'
    string OPTION_QUERY

    query option

    query option

    # 'query'
    string OPTION_CHECKSUM

    checksum option

    checksum option

    # 'checksum'
    string OPTION_REVISION

    revision option

    revision option

    # 'revision'
    string OPTION_PROPERTIES

    properties option

    properties option

    # 'properties'
    string OPTION_FIGURES

    figures option

    figures option

    # 'figures'
    string OPTION_LOAD

    load option

    load option

    # 'load'
    string OPTION_UNLOAD

    unload option

    unload option

    # 'unload'
    string OPTION_TRUNCATE

    truncate option

    truncate option

    # 'truncate'
    string OPTION_RENAME

    rename option

    rename option

    # 'rename'
    string OPTION_EXCLUDE_SYSTEM

    exclude system collections

    exclude system collections

    # 'excludeSystem'
    ArangoDB-PHP API Documentation API documentation generated by ApiGen