Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-9673

Looks like two manual page's explains are somewhat conflicted.

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • Affects Version/s: 3.4.0
    • Component/s: manual
    • Labels:
      None

      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}

      ) ?

            Assignee:
            Unassigned Unassigned
            Reporter:
            sunguck.lee@gmail.com 아나 하리
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              1 year, 25 weeks, 3 days ago