Skip to content

Commit c963172

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

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
@@ -37,6 +37,16 @@ Single Document Modification Operations in Sharded Collections
3737

3838
.. include:: /includes/fact-single-modification-in-sharded-collections.rst
3939

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

4252
Unique Indexes in Sharded Collections

0 commit comments

Comments
 (0)