Skip to content

Commit 42591be

Browse files
(DOCS-14763): Clarify sample agg behavior warning
1 parent 46b6b15 commit 42591be

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

source/reference/operator/aggregation/sample.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,18 @@ collection scan followed by a random sort to select N documents. In
4444
this case, the :pipeline:`$sample` stage is subject to the
4545
:ref:`sort memory restrictions <sort-memory-limit>`.
4646

47-
.. warning::
47+
MMAPV1 May Return Duplicate Documents
48+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4849

49-
:pipeline:`$sample` may output the same document more than once in
50-
its result set.
50+
If you are using the:
51+
52+
- MMAPV1 storage engine, :pipeline:`$sample` may return the same
53+
document more than once in the result set.
54+
55+
- :ref:`WiredTiger <storage-wiredtiger>` or
56+
:ref:`in-memory <storage-inmemory>` storage engine,
57+
:pipeline:`$sample` does not return duplicate documents. WiredTiger
58+
is the default storage engine as of MongoDB 3.2.
5159

5260
Example
5361
--------

0 commit comments

Comments
 (0)