[SERVER-11000] Insert issue. Created: 02/Oct/13 Updated: 02/Oct/13 Resolved: 02/Oct/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Chris Beck | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
mongos> db.FeedData.insert( { item: "card", qty: 15 } ) : { _id: ObjectId('524c0a6b3a6b2a9f5ee3621d'), item: "card", qty: 15.0 }mongos> db.FeedData.insert( { item: "card", qty: 15, 'd.auction_id_64': 1234 } ) The only problem here is shard key is d.auction_id_64. What am I missing here?! { "_id" : "lld", "partitioned" : true, "primary" : "mongo-cl1-sh1" } lld.FeedData chunks: |
| Comments |
| Comment by Scott Hernandez (Inactive) [ 02/Oct/13 ] | ||
|
You cannot have "." in field names . The index and shard key are specified using dot-notation but your documents don't have field names with dots in them. What you are want is an embedded field/document like this:
| ||
| Comment by Chris Beck [ 02/Oct/13 ] | ||
|
Fairly certain this is a bug... This worked as expected: mongos> sh.shardCollection('lld.FeedData', {'auction_id_64':'hashed'}); { "collectionsharded" : "lld.FeedData", "ok" : 1 }mongos> db.FeedData.insert( { item: "card", qty: 15 } ) : { _id: ObjectId('524c0bf13a6b2a9f5ee3621f'), item: "card", qty: 15.0 }mongos> db.FeedData.insert( { item: "card", qty: 15, auction_id_64:22333 } ) |