Changes for beta10 (#5)
- Add In/InArray support - Add ORDER BY support for `Find` functions - Update dependencies - Implement fixes identified via static analysis Reviewed-on: #5
This commit was merged in pull request #5.
This commit is contained in:
@@ -31,23 +31,23 @@ class Count
|
||||
* Count matching documents using a comparison on JSON fields
|
||||
*
|
||||
* @param string $tableName The name of the table in which documents should be counted
|
||||
* @param array|Field[] $fields The field comparison to match
|
||||
* @param Field[] $fields The field comparison to match
|
||||
* @param FieldMatch|null $match How to handle multiple conditions (optional; defaults to All)
|
||||
* @return int The count of documents matching the field comparison
|
||||
* @throws DocumentException If one is encountered
|
||||
*/
|
||||
public static function byFields(string $tableName, array $fields, ?FieldMatch $match = null): int
|
||||
{
|
||||
$namedFields = Parameters::nameFields($fields);
|
||||
return Custom::scalar(Query\Count::byFields($tableName, $namedFields, $match),
|
||||
Parameters::addFields($namedFields, []), new CountMapper());
|
||||
Parameters::nameFields($fields);
|
||||
return Custom::scalar(Query\Count::byFields($tableName, $fields, $match), Parameters::addFields($fields, []),
|
||||
new CountMapper());
|
||||
}
|
||||
|
||||
/**
|
||||
* Count matching documents using a JSON containment query (`@>`; PostgreSQL only)
|
||||
*
|
||||
* @param string $tableName The name of the table in which documents should be counted
|
||||
* @param array|object $criteria The criteria for the JSON containment query
|
||||
* @param mixed[]|object $criteria The criteria for the JSON containment query
|
||||
* @return int The number of documents matching the JSON containment query
|
||||
* @throws DocumentException If the database mode is not PostgreSQL, or if an error occurs
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user