[SERVER-9353] Duplicate keys in stored and shell object Created: 15/Apr/13  Updated: 09/Jul/16  Resolved: 15/Apr/13

Status: Closed
Project: Core Server
Component/s: JavaScript, Shell
Affects Version/s: 2.4.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Paul Klimashkin Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: bson, javascript
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7x64, Ubuntu 10.04x32


Issue Links:
Duplicate
duplicates SERVER-9066 Field names can be repeated in JavaSc... Closed
Operating System: ALL
Steps To Reproduce:

Try it in shell:
> db.test.insert({g: 1, y: {"1890" : 2, "1967" : 1, "1986" : 1, "1965" : 1)
> var yy = db.test.findOne(

{g: 1}

).y; printjson(yy); yy['1961'] = 1; printjson(yy);}}

In 2.2.0 output:

{ "1890" : 2, "1967" : 1, "1986" : 1, "1965" : 1 } { "1890" : 2, "1967" : 1, "1986" : 1, "1965" : 1, "1961" : 1 }

In 2.4.1 output

{ "1890" : 2, "1965" : 1, "1967" : 1, "1986" : 1 }

{
"1961" : 1,
"1890" : 2,
"1965" : 1,
"1967" : 1,
"1986" : 1,
"1961" : 1
}

Participants:

 Description   

Shell write keys to object twice. Moreover, double keys can be stored in the database.



 Comments   
Comment by Tad Marshall [ 15/Apr/13 ]

Thanks for testing it!

Comment by Paul Klimashkin [ 15/Apr/13 ]

Yeah, seems that in version 2.4.2 it's fixed

Comment by Tad Marshall [ 15/Apr/13 ]

Hi Paul,

I think that this is SERVER-9066, which is fixed in version 2.4.2. Can you try the release candidate (2.4.2-rc0) for version 2.4.2 and see if this fixes the problem for you?

Thanks!

Tad

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