Skip to content

Commit 72067cd

Browse files
jason-price-mongodbjason-price-mongodb
and
jason-price-mongodb
authored
DOCS-14854 findOneAndUpdate sharded (#6039) (#6042)
Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com> Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
1 parent aebd00d commit 72067cd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/core/sharded-cluster-requirements.txt

+10
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ Single Document Modification Operations in Sharded Collections
3939

4040
.. include:: /includes/fact-single-modification-in-sharded-collections.rst
4141

42+
To use :method:`~db.collection.findOneAndUpdate()` with a sharded
43+
collection, your query filter must include an equality condition on the
44+
:term:`shard key` to compare the key and value in either of these
45+
formats:
46+
47+
.. code-block:: javascript
48+
49+
{ key: value }
50+
{ key: { $eq: value } }
51+
4252
.. _sharding-requirements-unique-indexes:
4353

4454
Unique Indexes in Sharded Collections

0 commit comments

Comments
 (0)