|
MongoCollection::countCounts the number of documents in this collection Description
public int MongoCollection::count
([ array
$query = array()
[, array $options = array()
]] )Parameters
Return ValuesReturns the number of documents matching the query. Errors/ExceptionsThrows MongoResultException if the server could not execute the command due to an error. Throws MongoExecutionTimeoutException if command execution was terminated due to maxTimeMS. Changelog
ExamplesExample #1 MongoCollection::count example
<?php The above example will output something similar to: int(3) int(1) |