diff --git a/docs/reference/method/MongoDBCollection-countDocuments.txt b/docs/reference/method/MongoDBCollection-countDocuments.txt index 61e292e69..b66171c27 100644 --- a/docs/reference/method/MongoDBCollection-countDocuments.txt +++ b/docs/reference/method/MongoDBCollection-countDocuments.txt @@ -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: diff --git a/docs/reference/method/MongoDBCollection-createIndex.txt b/docs/reference/method/MongoDBCollection-createIndex.txt index ff4150eac..6385b578b 100644 --- a/docs/reference/method/MongoDBCollection-createIndex.txt +++ b/docs/reference/method/MongoDBCollection-createIndex.txt @@ -73,7 +73,7 @@ The output would then resemble:: Create a Partial Index ~~~~~~~~~~~~~~~~~~~~~~ -The following example adds a :manual:`partial index ` on +The following example adds a :manual:`partial index ` on the ``borough`` field in the ``restaurants`` collection in the ``test`` database. The partial index indexes only documents where the ``borough`` field exists.