Unverified Commit 051f3451 authored by Andreas Braun's avatar Andreas Braun

Merge pull request #735

* phplib-434:
  Fix typo in index documentation
  PHPLIB-434: Add note about performance of countDocuments
parents 632cd8b9 89721f07
......@@ -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
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
within a :phpmethod:`MongoDB\\Collection::count()` ``filter`` cannot be used.
Consider the following alternatives to these restricted operators:
......
......@@ -73,7 +73,7 @@ The output would then resemble::
Create a Partial Index
~~~~~~~~~~~~~~~~~~~~~~
The following example adds a :manual:`partial index </core/index-parital>` on
The following example adds a :manual:`partial index </core/index-partial>` on
the ``borough`` field in the ``restaurants`` collection in the ``test``
database. The partial index indexes only documents where the ``borough`` field
exists.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment