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
2cd8079c
Unverified
Commit
2cd8079c
authored
Apr 06, 2020
by
Andreas Braun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-434: Add note about performance of countDocuments
parent
632cd8b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
MongoDBCollection-countDocuments.txt
docs/reference/method/MongoDBCollection-countDocuments.txt
+8
-0
No files found.
docs/reference/method/MongoDBCollection-countDocuments.txt
View file @
2cd8079c
...
@@ -52,6 +52,14 @@ obtain the result. If a ``filter`` parameter is given, this is converted into
...
@@ -52,6 +52,14 @@ 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.
.. note::
This method counts documents on the server side. To obtain an approximate
total number of documents without filters, the
:phpmethod:`MongoDB\\Collection::estimatedDocumentCount()` method can be
used. This method estimates the number of documents based on collection
metadata, thus sacrificing accuracy for performance.
Since this method uses an aggregation pipeline, some query operators accepted
Since this method uses an aggregation pipeline, some query operators accepted
within a :phpmethod:`MongoDB\\Collection::count()` ``filter`` cannot be used.
within a :phpmethod:`MongoDB\\Collection::count()` ``filter`` cannot be used.
Consider the following alternatives to these restricted operators:
Consider the following alternatives to these restricted operators:
...
...
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