Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
2bb06ca1
Commit
2bb06ca1
authored
Jun 27, 2018
by
Jeremy Mikola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-359: Alternatives to restricted query operators for countDocuments()
parent
bfc80b8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
MongoDBCollection-countDocuments.txt
docs/reference/method/MongoDBCollection-countDocuments.txt
+20
-1
No files found.
docs/reference/method/MongoDBCollection-countDocuments.txt
View file @
2bb06ca1
...
@@ -51,7 +51,26 @@ Behavior
...
@@ -51,7 +51,26 @@ Behavior
Internally, this method uses the ``$group`` aggregation pipeline operator to
Internally, this method uses the ``$group`` aggregation pipeline operator to
obtain the result. If a ``filter`` parameter is given, this is converted into
obtain the result. If a ``filter`` parameter is given, this is converted into
a ``$match`` pipeline operator. Optional ``
skip`` and ``
limit`` stages are
a ``$match`` pipeline operator. Optional ``
$skip`` and ``$
limit`` stages are
added between ``$match`` and ``group`` if present in the options.
added between ``$match`` and ``group`` if present in the options.
Since this method uses an aggregation pipeline, some query operators accepted
within a :phpmethod:`MongoDB\\Collection::count()` ``filter`` cannot be used.
Consider the following alternatives to these restricted operators:
.. list-table::
:header-rows: 1
* - Restricted
- Alternative Syntax
* - :query:`$near`
- :query:`$geoWithin` with :query:`$center`
* - :query:`$nearSphere`
- :query:`$geoWithin` with :query:`$centerSphere`
* - :query:`$where`
- :query:`$expr` (requires MongoDB 3.6+)
.. todo: add output and examples
.. todo: add output and examples
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment