diff --git a/source/core/sharded-cluster-requirements.txt b/source/core/sharded-cluster-requirements.txt index e0d5c9c281f..2db0a3c2f94 100644 --- a/source/core/sharded-cluster-requirements.txt +++ b/source/core/sharded-cluster-requirements.txt @@ -37,6 +37,16 @@ Single Document Modification Operations in Sharded Collections .. include:: /includes/fact-single-modification-in-sharded-collections.rst +To use :method:`~db.collection.findOneAndUpdate()` with a sharded +collection, your query filter must include an equality condition on the +:term:`shard key` to compare the key and value in either of these +formats: + +.. code-block:: javascript + + { key: value } + { key: { $eq: value } } + .. _sharding-requirements-unique-indexes: Unique Indexes in Sharded Collections