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

Document the limitation of removing a single document in sharded the collection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: v1.3.3
    • Component/s: manual
    • Last comment by Customer:
      true
    • Actual Time:
      4

      Description

      If you delete only one document (using justOne option) without querying by _id, like so:

      db.collection.remove({a:1}, true)

      you'll get this assertion:

      can only delete with a non-shard key pattern if can delete as many as we find

      This is a restriction for sharded collections. See source code:
      https://github.com/mongodb/mongo/blob/v2.4/src/mongo/s/strategy_shard.cpp#L1153

      A warning/note should be added here:
      http://docs.mongodb.org/manual/reference/method/db.collection.remove/

      This limitation still exists in 2.6

        Attachments

          Activity

            People

            Assignee:
            sam.kleinman Sam Kleinman (Inactive)
            Reporter:
            gianfranco Gianfranco Palumbo
            Participants:
            Last commenter:
            Jonathan Dahl Jonathan Dahl
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since reply:
              7 years, 30 weeks, 1 day ago
              Date of 1st Reply: