ENTRY_DOCUMENTS
ENTRY_DOCUMENTS
documents array index
Provides management of collections
The collection handler fetches collection data from the server and
creates collections on the server.
__construct(\triagens\ArangoDb\Connection $connection) : \triagens\ArangoDb\Handler
Construct a new handler
\triagens\ArangoDb\Connection | $connection |
|
get(mixed $collectionId) : \triagens\ArangoDb\Collection
Get information about a collection
This will throw if the collection cannot be fetched from the server
mixed | $collectionId |
|
getProperties(mixed $collectionId) : \triagens\ArangoDb\Collection
Get properties of a collection
This will throw if the collection cannot be fetched from the server
mixed | $collectionId |
|
getCount(mixed $collectionId) : integer
Get the number of documents in a collection
This will throw if the collection cannot be fetched from the server
mixed | $collectionId |
|
count(mixed $collectionId) : integer
Get the number of documents in a collection
This will throw if the collection cannot be fetched from the server
mixed | $collectionId |
|
None found |
getFigures(mixed $collectionId) : array
Get figures for a collection
This will throw if the collection cannot be fetched from the server
mixed | $collectionId |
|
None found |
figures(mixed $collectionId) : array
Get figures for a collection
This will throw if the collection cannot be fetched from the server
mixed | $collectionId |
|
None found |
add(\triagens\ArangoDb\Collection $collection) : mixed
Adds a new collection on the server
This will add the collection on the server and return its id
This will throw if the collection cannot be created
\triagens\ArangoDb\Collection | $collection |
|
None found |
create(mixed $collection, array $options) : mixed
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
mixed | $collection |
|
array | $options |
|
None found |
getChecksum(mixed $collectionId, boolean $withRevisions, boolean $withData) : array
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.
mixed | $collectionId |
|
boolean | $withRevisions |
|
boolean | $withData |
|
None found |
getRevision(mixed $collectionId) : array
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.
mixed | $collectionId |
|
None found |
createCapConstraint(string $collectionId, integer $size) : array
Create a cap constraint
string | $collectionId |
|
integer | $size |
|
None found |
createGeoIndex(string $collectionId, array $fields, boolean $geoJson, boolean $constraint, boolean $ignoreNull) : array
Create a geo index
string | $collectionId |
|
array | $fields |
|
boolean | $geoJson |
|
boolean | $constraint |
|
boolean | $ignoreNull |
|
None found |
createHashIndex(string $collectionId, array $fields, boolean $unique) : array
Create a hash index
string | $collectionId |
|
array | $fields |
|
boolean | $unique |
|
None found |
createFulltextIndex(string $collectionId, array $fields, integer $minLength) : array
Create a fulltext index
string | $collectionId |
|
array | $fields |
|
integer | $minLength |
|
None found |
createSkipListIndex(string $collectionId, array $fields, boolean $unique) : array
Create a skip-list index
string | $collectionId |
|
array | $fields |
|
boolean | $unique |
|
None found |
index(mixed $collectionId, string $type, array $attributes, boolean $unique, array $indexOptions) : array
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
mixed | $collectionId |
|
string | $type |
|
array | $attributes |
|
boolean | $unique |
|
array | $indexOptions |
|
None found |
getIndex(string $collection, string $indexId) : array
Get the information about an index in a collection
string | $collection |
|
string | $indexId |
|
None found |
getIndexes(mixed $collectionId) : array
Get indexes of a collection
This will throw if the collection cannot be fetched from the server
mixed | $collectionId |
|
$data - the indexes result-set from the server
None found |
dropIndex(mixed $indexHandle) : boolean
Drop an index
mixed | $indexHandle |
|
None found |
delete(mixed $collection) : boolean
Delete a collection
mixed | $collection |
|
None found |
drop(mixed $collection) : boolean
Drop a collection
mixed | $collection |
|
None found |
rename(mixed $collection, string $name) : boolean
Rename a collection
mixed | $collection |
|
string | $name |
|
None found |
load(mixed $collection) : \triagens\ArangoDb\HttpResponse
Load a collection into the server's memory
This will load the given collection into the server's memory.
mixed | $collection |
|
None found |
unload(mixed $collection) : \triagens\ArangoDb\HttpResponse
Unload a collection from the server's memory
This will unload the given collection from the server's memory.
mixed | $collection |
|
None found |
truncate(mixed $collection) : boolean
Truncate a collection
This will remove all documents from the collection but will leave the metadata and indexes intact.
mixed | $collection |
|
None found |
byExample(mixed $collectionId, mixed $document, boolean|array $options) : \triagens\ArangoDb\cursor
Get document(s) by specifying an example
This will throw if the list cannot be fetched from the server
mixed | $collectionId |
|
mixed | $document |
|
boolean|array | $options |
|
None found |
fulltext(mixed $collectionId, mixed $attribute, mixed $query, boolean|array $options) : \triagens\ArangoDb\cursor
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.
mixed | $collectionId |
|
mixed | $attribute |
|
mixed | $query |
|
boolean|array | $options |
|
None found |
firstExample(mixed $collectionId, mixed $document, boolean|array $options) : \triagens\ArangoDb\Document
Get the first document matching a given example.
This will throw if the document cannot be fetched from the server
mixed | $collectionId |
|
mixed | $document |
|
boolean|array | $options |
|
since | 1.2 |
---|
any(mixed $collectionId) : \triagens\ArangoDb\Document
Get a random document from the collection.
This will throw if the document cannot be fetched from the server
mixed | $collectionId |
|
since | 1.2 |
---|
first(mixed $collectionId, integer $count) : array
This will return the first documents from the collection, in the order of insertion/update time.
When the count argument is supplied, the result will be a list of documents, with the "oldest" document being first in the result list. If the count argument is not supplied, the result is the "oldest" document of the collection, or null if the collection is empty.
mixed | $collectionId |
|
integer | $count |
|
since | 1.4 |
---|
last(mixed $collectionId, integer $count) : array
This will return the last documents from the collection, in the order of insertion/update time.
When the count argument is supplied, the result will be a list of documents, with the "latest" document being first in the result list. If the count argument is not supplied, the result is the "latest" document of the collection, or null if the collection is empty.
mixed | $collectionId |
|
integer | $count |
|
since | 1.4 |
---|
updateByExample(mixed $collectionId, mixed $example, mixed $newValue, mixed $options) : boolean
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
mixed | $collectionId |
|
mixed | $example |
|
mixed | $newValue |
|
mixed | $options |
|
since | 1.2 |
---|
replaceByExample(mixed $collectionId, mixed $example, mixed $newValue, mixed $options) : boolean
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
mixed | $collectionId |
|
mixed | $example |
|
mixed | $newValue |
|
mixed | $options |
|
since | 1.2 |
---|
removeByExample(mixed $collectionId, mixed $document, boolean|array $options) : integer
Remove document(s) by specifying an example
This will throw on any error
mixed | $collectionId |
|
mixed | $document |
|
boolean|array | $options |
|
since | 1.2 |
---|
range(mixed $collectionId, string $attribute, mixed $left, mixed $right, array $options) : \triagens\ArangoDb\Cursor
Get document(s) by specifying range
This will throw if the list cannot be fetched from the server
mixed | $collectionId |
|
string | $attribute |
|
mixed | $left |
|
mixed | $right |
|
array | $options |
|
None found |
all(mixed $collectionId, array $options) : \triagens\ArangoDb\Cursor
Returns all documents of a collection
mixed | $collectionId |
|
array | $options |
|
None found |
near(mixed $collectionId, double $latitude, double $longitude, array $options) : \triagens\ArangoDb\Cursor
Get document(s) by specifying near
This will throw if the list cannot be fetched from the server
mixed | $collectionId |
|
double | $latitude |
|
double | $longitude |
|
array | $options |
|
None found |
within(mixed $collectionId, double $latitude, double $longitude, integer $radius, array $options) : \triagens\ArangoDb\Cursor
Get document(s) by specifying within
This will throw if the list cannot be fetched from the server
mixed | $collectionId |
|
double | $latitude |
|
double | $longitude |
|
integer | $radius |
|
array | $options |
|
None found |
getAllIds(mixed $collectionId) : array
Get the list of all documents' ids from a collection
This will throw if the list cannot be fetched from the server
mixed | $collectionId |
|
None found |
isValidCollectionId( $collectionId) : boolean
Checks if the collectionId given, is valid. Returns true if it is, or false if it is not.
$collectionId |
None found |
getAllCollections(array $options) : array
Get list of all available collections per default with the collection names as index.
Returns empty array if none are available.
array | $options |
|
None found |
getCollectionId(mixed $collection) : mixed
Gets the collectionId from the given collectionObject or string/integer
mixed | $collection |
None found |
getCollectionName(mixed $collection) : mixed
Gets the collectionId from the given collectionObject or string/integer
mixed | $collection |
None found |
importFromFile(mixed $collectionId, mixed $importFileName, array $options) : integer
Import documents from a file
This will throw on all errors except insertion errors
mixed | $collectionId |
|
mixed | $importFileName |
|
array | $options |
|
None found |
import(mixed $collectionId, mixed $importData, array $options) : integer
Import documents into a collection
This will throw on all errors except insertion errors
mixed | $collectionId |
|
mixed | $importData |
|
array | $options |
|
None found |
getConnection() : \triagens\ArangoDb\Connection
Return the connection object
None found |
getConnectionOption( $optionName) : mixed
Return a connection option This is a convenience function that calls json_encode_wrapper on the connection
$optionName |
|
None found |
getCursorOptions(mixed $options) : array
Return an array of cursor options
mixed | $options |
|
None found |
json_encode_wrapper(array $body) : string
Return a json encoded string for the array passed.
This is a convenience function that calls json_encode_wrapper on the connection
array | $body |
|
None found |
validateAndIncludeOldSingleParameterInParams(array $options, array $params, mixed $parameter) : array
Helper function that validates and includes an old single method parameter setting into the parameters array given.
This is only for keeping backwards-compatibility where methods had for example a parameter which was called 'policy' and which was later changed to being an array of options, so more than one options can be passed easily. This is only for options that are to be sent to the ArangoDB server.
array | $options |
|
array | $params |
|
mixed | $parameter |
|
$params - array of parameters for use in a url
None found |
includeOptionsInParams(array $options, array $params, array $includeArray) : array
Helper function that runs through the options given and includes them into the parameters array given.
Only options that are set in $includeArray will be included. This is only for options that are to be sent to the ArangoDB server in form of url parameters (like 'waitForSync', 'keepNull', etc...) .
array | $options |
|
array | $params |
|
array | $includeArray |
|
$params - array of parameters for use in a url
None found |
includeOptionsInBody(array $options, array $body, array $includeArray) : array
Helper function that runs through the options given and includes them into the parameters array given.
Only options that are set in $includeArray will be included. This is only for options that are to be sent to the ArangoDB server in a json body(like 'limit', 'skip', etc...) .
array | $options |
|
array | $body |
|
array | $includeArray |
|
$params - array of parameters for use in a url
None found |