File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,26 @@ Behavior
51
51
52
52
Internally, this method uses the ``$group`` aggregation pipeline operator to
53
53
obtain the result. If a ``filter`` parameter is given, this is converted into
54
- a ``$match`` pipeline operator. Optional ``skip`` and ``limit`` stages are
54
+ a ``$match`` pipeline operator. Optional ``$ skip`` and ``$ limit`` stages are
55
55
added between ``$match`` and ``group`` if present in the options.
56
56
57
+ Since this method uses an aggregation pipeline, some query operators accepted
58
+ within a :phpmethod:`MongoDB\\Collection::count()` ``filter`` cannot be used.
59
+ Consider the following alternatives to these restricted operators:
60
+
61
+ .. list-table::
62
+ :header-rows: 1
63
+
64
+ * - Restricted
65
+ - Alternative Syntax
66
+
67
+ * - :query:`$near`
68
+ - :query:`$geoWithin` with :query:`$center`
69
+
70
+ * - :query:`$nearSphere`
71
+ - :query:`$geoWithin` with :query:`$centerSphere`
72
+
73
+ * - :query:`$where`
74
+ - :query:`$expr` (requires MongoDB 3.6+)
75
+
57
76
.. todo: add output and examples
You can’t perform that action at this time.
0 commit comments