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

Document restrictions on write ops for sharded collections

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • Server_Docs_20231030
    • None
    • manual
    • None

    Description

      e.g.

      mongos> sh.shardCollection("test.collection",{_id:"hashed"})
      { "collectionsharded" : "test.collection", "ok" : 1 }
      mongos> db.collection.update({},{$set:{a:1}},{upsert:false,multi:false})
      For non-multi updates, must have _id or full shard key ({ _id: "hashed" }) in query
      mongos> db.collection.update({},{$set:{a:1}},{upsert:true,multi:true})
      can't upsert something without full valid shard key : {}
      mongos> db.collection.remove({},true)
      can only delete with a non-shard key pattern if can delete as many as we find : {}
      mongos>

      Attachments

        Activity

          People

            sam.kleinman Sam Kleinman (Inactive)
            rassi J Rassi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              10 years, 28 weeks, 1 day ago