How can I check the total number of collections in arangodb in PHP?
This is what I tried:
$documents = $collectionHandler->all($collectionId);
var_dump($documents);
How can I check the total number of collections in arangodb in PHP?
This is what I tried:
$documents = $collectionHandler->all($collectionId);
var_dump($documents);
To get the number of collections present, you can use CollectionHandler::getAllCollections()
for this purpose:
// create the connection as usual
$handler = new \triagens\ArangoDb\CollectionHandler($connection);
$collections = $handler->getAllCollections();
$collectionNames = array_values($collections);
$collectionCount = count($collectionNames);
To get the number of documents in a collection, as your code example suggests, use CollectionHandler::count($collection)