[SERVER-18331] Remove justOne, with sharding, fails when specifying a comparison query operator Created: 05/May/15 Updated: 09/Jul/16 Resolved: 05/May/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying, Sharding |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jonathan Abrahams | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | 32qa | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
|||||||||||
| Backwards Compatibility: | Fully Compatible | |||||||||||
| Operating System: | ALL | |||||||||||
| Steps To Reproduce: |
|
|||||||||||
| Participants: | ||||||||||||
| Description |
|
To remove a document in a sharded collection, using the justOne option, the shard key is required. This works for the equality operator. Specify a comparison operator and it fails, i.e., $gte, $lt, with the following error:
|
| Comments |
| Comment by Jonathan Abrahams [ 05/May/15 ] |
|
Perhaps the documentation and error message both require improvement, if theses type of queries are not supported in a sharded environment. The documentation is unclear what is meant by "must include the shard key or the _id field in the query specification". The error message and documentation should be more precise in defining the type of queries for the justOne options. |
| Comment by Scott Hernandez (Inactive) [ 05/May/15 ] |
|
How is this a bug? The query does not contain a concrete shard key (as you specify a range of possible shard key values) nor the _id of the document, as stated in the error message. Here are the docs about this behavior: http://docs.mongodb.org/manual/reference/limits/#Single-Document-Modification-Operations-in-Sharded-Collections Are you just suggesting the error message should be better, or documentation should be improved? |