Skip to content

Commit a49e8f6

Browse files
committed
edits
1 parent 3694bb5 commit a49e8f6

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

source/includes/read/count.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@
2525

2626
// Counts a maximum of 100 documents that have a "number_of_employees" value of 50
2727
// start-modify-accurate
28-
$options = ['limit' => 100];
29-
$result = $collection->countDocuments(['number_of_employees' => 50], $options);
28+
$result = $collection->countDocuments(
29+
['number_of_employees' => 50],
30+
['limit' => 100]
31+
);
3032
echo "Number of companies with 50 employees: " . $result;
3133
// end-modify-accurate
3234

@@ -38,7 +40,6 @@
3840

3941
// Estimates the number of documents in the collection and sets a time limit on the operation
4042
// start-modify-estimate
41-
$options = ['maxTimeMS' => 1000];
42-
$result = $collection->estimatedDocumentCount($options);
43+
$result = $collection->estimatedDocumentCount(['maxTimeMS' => 1000]);
4344
echo "Estimated number of documents: " . $result;
4445
// end-modify-estimate

source/read/count.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ Retrieve an Accurate Count
4949
--------------------------
5050

5151
Use the ``MongoDB\Collection::countDocuments()`` method to count the number of documents
52-
that are in a collection. To count the number of documents that match a specific search
53-
critera, pass a query filter to the ``countDocuments()`` method.
52+
in a collection. To count the number of documents that match specific search criteria,
53+
pass a query filter to the ``countDocuments()`` method.
5454

5555
To learn more about specifying a query, see the :ref:`php-specify-query` guide.
5656

0 commit comments

Comments
 (0)