CollectionFind::having
(No version information available, might only be in Git)
CollectionFind::having — Set condition for aggregate functions
Beschreibung
This function can be used after the 'field' operation in order to make a selection on the documents to extract.
Parameter-Liste
-
sort_expr
-
This must be a valid SQL expression, the use of aggreate functions is allowed
Rückgabewerte
CollectionFind object that can be used for further processing
Beispiele
Beispiel #1 mysql_xdevapi\CollectionFind::having() example
<?php
//Assuming $coll is a valid Collection object
//Find all the documents for which the 'age' is greather than 40,
//Only the columns 'name' and 'age' are returned in the Result object
$res = $coll->find()->fields(['name','age'])->having('age > 40')->execute();
?>