You can use the schema manager to perform CRUD actions on collections within an ArangoDB database.
The schema manager supports the following collection functions:
Get a list of collections within the database
$arangoClient->schema()->getCollections();
Get the requested collection.
$arangoClient->schema()->getCollection('_fishbowl');
Get the properties of the requested collection.
$arangoClient->schema()->getCollectionProperties('_fishbowl');
Get the properties of the requested collection.
$arangoClient->schema()->getCollectionWithDocumentCount('_fishbowl');
Get the number of documents within the requested collection.
$arangoClient->schema()->getCollectionDocumentCount('users');
Get the properties of the requested collection.
$arangoClient->schema()->getCollectionStatistics('_fishbowl');
Check if a collection exists.
$arangoClient->schema()->hasCollection('_fishbowl');
createCollection(string $name, array $config = [], $waitForSyncReplication = null, $enforceReplicationFactor = null): stdClass
Create a collection
$arangoClient->schema()->createCollection('users');
createEdgeCollection(string $name, array $config = [], $waitForSyncReplication = null, $enforceReplicationFactor = null): stdClass
Create an Edge collection
$arangoClient->schema()->createEdgeCollection('relationships');
Update a collection
$arangoClient->schema()->updateCollection('users', ['waitForSync' => true]);
Rename a collection
$arangoClient->schema()->renameCollection('users', 'characters');
Truncate a collection.
$arangoClient->schema()->truncateCollection('teams');
Delete a collection
$arangoClient->schema()->deleteCollection('users');
This method deletes all non-system collections available on the current database.
$arangoClient->schema()->deleteAllCollections();