【发布时间】:2016-10-27 14:22:52
【问题描述】:
如何在 PHP 中查看 arangodb 中的集合总数?
这是我尝试过的:
$documents = $collectionHandler->all($collectionId);
var_dump($documents);
【问题讨论】:
-
您可以提供任何进展或其他反馈吗?答案解决了你的问题吗?
标签: arangodb arangodb-php
如何在 PHP 中查看 arangodb 中的集合总数?
这是我尝试过的:
$documents = $collectionHandler->all($collectionId);
var_dump($documents);
【问题讨论】:
标签: arangodb arangodb-php
要获取当前集合的数量,您可以为此目的使用CollectionHandler::getAllCollections():
// create the connection as usual
$handler = new \triagens\ArangoDb\CollectionHandler($connection);
$collections = $handler->getAllCollections();
$collectionNames = array_values($collections);
$collectionCount = count($collectionNames);
如您的代码示例所示,要获取集合中的文档数,请使用CollectionHandler::count($collection)
【讨论】: