[SERVER-8831] Able to unset embedded parts of the shard key -- changing it Created: 02/Mar/13  Updated: 08/Mar/13  Resolved: 04/Mar/13

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 2.4.0-rc1
Fix Version/s: None

Type: Bug Priority: Critical - P2
Reporter: Sridhar Nanjundeswaran Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

2.4.0-rc1 build on Windows 7


Attachments: File ShardKeyUnset.js    
Issue Links:
Depends
Duplicate
duplicates SERVER-7379 Immutable shardkey becomes mutable Closed
Operating System: ALL
Steps To Reproduce:

mongo ShardKeyUnset.js

Participants:

 Description   

The test below fails with
assert: [null] != [null] are equal : undefined
Error: Printing Stack Trace
at printStackTrace (src/mongo/shell/utils.js:37:7)
at doassert (src/mongo/shell/assert.js:6:1)
at Function.assert.neq (src/mongo/shell/assert.js:44:1)
at c:\Users\sridhar\Desktop\ShardKeyUnset.js:39:8

Expect the document to be unchanged
{ "_id" : -1, "ckey" :

{ "key1" : -1, "key2" : -1 }

, "val" : -1 }
Instead the update goes through resulting in
{ "_id" : -1, "ckey" : { }, "val" : -100 }


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