[SERVER-3565] Improve error message when trying to shard on non-existent field Created: 09/Aug/11 Updated: 12/Jul/16 Resolved: 13/Oct/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Sharding |
| Affects Version/s: | 1.8.2 |
| Fix Version/s: | 2.1.0 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Daniel Pasette (Inactive) | Assignee: | Greg Studer |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
| Participants: |
| Description |
|
If any of the shard keys don't exist, the error message is fairly opaque. Could it mention the document _id. > db.runCommand( { shardcollection : "" + coll, key : { bucketId : 1, entityId : 1, variationId : 1 }} ) { "ok" : 0, "errmsg" : "exception: invalid parameter: expected an object ()" } |
| Comments |
| Comment by auto [ 13/Oct/11 ] |
|
Author: {u'login': u'gregstuder', u'name': u'gregs', u'email': u'greg@10gen.com'}Message: |
| Comment by Greg Studer [ 13/Oct/11 ] |
|
actually this was the intention of the original code, but accidentally tries to get id of shard key object itself, hence the weird error. |
| Comment by auto [ 13/Oct/11 ] |
|
Author: {u'login': u'gregstuder', u'name': u'gregs', u'email': u'greg@10gen.com'}Message: |
| Comment by Greg Studer [ 13/Oct/11 ] |
|
Also shouldn't be able to shard over sparse collections. |