You are here

public function MongoDBQueue::numberOfItems in MongoDB 7

Retrieve the number of items in the queue.

Return value

int An integer estimate of the number of items in the queue.

Throws

\MongoConnectionException

Overrides DrupalQueueInterface::numberOfItems

File

mongodb_queue/mongodb_queue.inc, line 64
Contains \MongoDBQueue.

Class

MongoDBQueue

Code

public function numberOfItems() {
  return mongodb_collection($this->collection)
    ->count();
}