[SERVER-7951] cannot do replace-style updates when using hashed shard keys Created: 16/Dec/12  Updated: 11/Jul/16  Resolved: 19/Dec/12

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.3.0
Fix Version/s: 2.3.2

Type: Bug Priority: Major - P3
Reporter: Eliot Horowitz (Inactive) Assignee: Kevin Matulef
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Comments   
Comment by auto [ 16/Dec/12 ]

Author:

{u'date': u'2012-12-16T21:27:19Z', u'email': u'matulef@gmail.com', u'name': u'Kevin Matulef'}

Message: SERVER-7951 fix replacement-style updates with hashed shard key
Branch: master
https://github.com/mongodb/mongo/commit/81a8d87fa7a1a614ca0e0c0c93c260052af541b9

Comment by Kevin Matulef [ 16/Dec/12 ]

This includes using "save". For example, when the shard key is {_id : "hashed"}

mongos> db.foo.insert({_id : 1})
mongos> db.foo.save({_id : 1 , a : 2})
cannot modify shard key for collection test.foo, found new value for _id

similarly, if the shard key is

{a : "hashed"}

mongos> db.foo.insert({a : 1})
mongos> db.foo.update({a : 1 }, {a : 1 , b : 2})
cannot modify shard key for collection test.foo, found new value for a

Generated at Thu Feb 08 03:16:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.