[DOCS-9673] Looks like two manual page's explains are somewhat conflicted. Created: 20/Dec/16  Updated: 30/Oct/23

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: 3.4.0
Fix Version/s: Server_Docs_20231030

Type: Improvement Priority: Major - P3
Reporter: 아나 하리 Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 1 year, 14 weeks, 2 days ago
Epic Link: DOCSP-1769

 Description   

According to the mongos manual,
db.collection.update({}, {},

{multi:true}

) command always boradcast to all shard.

https://docs.mongodb.com/manual/core/sharded-cluster-query-router/
>> Multi-update operations are always broadcast operations.

And db.collection.update manual said, db.collection.update({}, {},

{multi:true}

) always need shard key for sharded collection.
https://docs.mongodb.com/v3.2/reference/method/db.collection.update/#multi-parameter
>> Sharded Collections
>> All update() operations for a sharded collection must include the shard key or the _id field
>> in the query specification. update() operations without the shard key or the _id field
>> return an error.

I think two document's explains are conflicted. why multi-update need shard key condition even they can't be targeted query.

And according to the mongos manual (above link), updateMany() and deleteMany() can be target query if full shard key condition is provided. then why multi-update can't be target query. Is there any differences between updateMany() and db.collection.update({}, {},

{multi:true}

) ?



 Comments   
Comment by Education Bot [ 31/Oct/22 ]

Hello! This ticket has been closed due to inactivity. If you believe this ticket is still important, please reopen it and leave a comment to explain why. Thank you!

Generated at Thu Feb 08 07:58:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.