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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Needs Triage
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: 3.4.0
    • Fix Version/s: None
    • Component/s: manual
    • Labels:
      None

      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}

      ) ?

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            matt.lee Matt SeongUck Lee
            Participants:
            Last commenter:
            Anthony Sansone Anthony Sansone
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Days since reply:
              4 years, 50 weeks, 2 days ago