lithium\data\source\MongoDb::calculation()
Executes calculation-related queries, such as those required for count
.
Parameters
-
string
$type
Only accepts
count
. -
mixed
$query
The query to be executed.
-
array
$options
Optional arguments for the
read()
query that will be executed to obtain the calculation result.
Returns
integerResult of the calculation.
Source
public function calculation($type, $query, array $options = []) {
$query->calculate($type);
switch ($type) {
case 'count':
return $this->read($query, $options)->count();
}
}