-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: manual
-
Labels:
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