[DOCS-1901] note that users do not need to compute hash values for hashed shard key values. Created: 09/Sep/13 Updated: 11/Jan/17 Resolved: 17/Sep/13 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 01112017-cleanup |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Kelly Stirman | Assignee: | Bob Grabar |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 10 years, 22 weeks, 1 day ago |
| Description |
|
This entry in the manual: http://docs.mongodb.org/manual/reference/command/findAndModify/ at the end says "Warning When using findAndModify in a sharded environment, the query must contain the shard key for all operations against the shard cluster. findAndModify operations issued against mongos instances for non-sharded collections function normally." We could specify that when using a hashed index simply specify the _id value, and/or we could modify this page: http://docs.mongodb.org/manual/tutorial/create-a-hashed-index/ Unsure if other pages may need to be updated. |
| Comments |
| Comment by auto [ 17/Sep/13 ] |
|
Author: {u'username': u'bgrabar', u'name': u'Bob Grabar', u'email': u'bob.grabar@10gen.com'}Message: Signed-off-by: Sam Kleinman <samk@10gen.com> |
| Comment by Bob Grabar [ 17/Sep/13 ] |
|
Viewable in github: |
| Comment by Sam Kleinman (Inactive) [ 09/Sep/13 ] |
|
actionable: add note to the hashed sharding section that mongodb automatically hashes the shard key, and applications do not need to hash keys before issuing read or write oeprations to the server. |
| Comment by Kelly Stirman [ 09/Sep/13 ] |
|
Agree that _id is irrelevant, my mistake. Still, a user could be confused to think they need to hash the shard key for findAndModify when using a hashed shard key. See https://groups.google.com/d/msg/mongodb-masters/lrSE6q8NGuM/t5zpE-OOH30J |
| Comment by Sam Kleinman (Inactive) [ 09/Sep/13 ] |
|
The _id field is not necessarily related to the hashed shard key, which might be of any field in the document. |
| Comment by Scott Hernandez (Inactive) [ 09/Sep/13 ] |
|
A shard key is a shard key. We should not say anything unless there is something special to say and in this case there isn't. |