[DOCS-14854] Mention "findOneAndUpdate" in "Single Document Modification Operations in Sharded Collections" Created: 07/Oct/21  Updated: 13/Nov/23  Resolved: 25/Oct/21

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: 4.0.0, 4.2.0, 4.4.0, 5.0.0, 5.1.0
Fix Version/s: 4.0.0, 4.2.0, 4.4.0, 5.0.0, 5.1.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Improvement Priority: Minor - P4
Reporter: Lungang Fang Assignee: Jason Price
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 2 years, 15 weeks, 2 days ago
Epic Link: DOCSP-11701
Story Points: 3

 Description   

Hi,

In the Single Document Modification Operations in Sharded Collections section of MongoDB documentation, it talks about updateOne() and deleteOne() but does not mention the findOneAndUpdate(). However, this command (i.e. findOneAndUpdate()) also subjects to similar limitation. Although the details can be found in Sharded Collections section (quoted below), I'd suggest also adding a reminder in the Single Document Modification Operations in Sharded Collections section to avoid confusion.

To use db.collection.findOneAndUpdate() on a sharded collection, the query filter must include an equality condition on the shard key.

Regards,
Lungang



 Comments   
Comment by Githook User [ 25/Oct/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14854 findOneAndUpdate sharded (#6039) (#6043)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v4.0
https://github.com/mongodb/docs/commit/c9631726b03e82699a98197dac669b2d82bcda97

Comment by Githook User [ 25/Oct/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14854 findOneAndUpdate sharded (#6039) (#6042)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v4.2
https://github.com/mongodb/docs/commit/72067cdd77efdab9d877461b8a8bbabeec045cb1

Comment by Githook User [ 25/Oct/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14854 findOneAndUpdate sharded (#6039) (#6041)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v4.4
https://github.com/mongodb/docs/commit/70662951518a9ce995eee71c144bc9b99b244031

Comment by Githook User [ 25/Oct/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14854 findOneAndUpdate sharded (#6039) (#6040)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v5.0
https://github.com/mongodb/docs/commit/58248eeb17e413a9feeab601d4d4fd75b39d4862

Comment by Githook User [ 25/Oct/21 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-14854 findOneAndUpdate sharded (#6039)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: master
https://github.com/mongodb/docs/commit/d582b9232e0dc0301eaf1073fe026157283e3cb2

Generated at Thu Feb 08 08:11:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.