[SERVER-115] Setting assoc array properties doesn't work Created: 24/Jun/09  Updated: 30/Jul/09  Resolved: 24/Jun/09

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

Type: Bug Priority: Major - P3
Reporter: Kristina Chodorow (Inactive) Assignee: Eliot Horowitz (Inactive)
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

Adding a new field fails:

> p=db.playlists.findOne()
{"_id" : "4a4270125fac18127c8c858c" , "songlist" : [

{"$ref" : "x.y" , "$id" : 6}

]}
> p.username = "me"
me
> p
{"_id" : "4a4270125fac18127c8c858c" , "songlist" : [

{"$ref" : "x.y" , "$id" : 6}

] , "username" : "me"}
> db.playlists.save(p)
> p=db.playlists.find()
{"_id" : "4a4270125fac18127c8c858c" , "songlist" : [

{"$ref" : "x.y" , "$id" : 6}

]}

Trying it another way gives a more disastrous result:

> x = db.playlists.findOne()
{"_id" : "4a4270125fac18127c8c858c" , "songlist" : [

{"$ref" : "x.y" , "$id" : 6}

]}
> x["username"] = "me"
Wed Jun 24 14:32:23 JS Error: SyntaxError: missing ] in index expression (shellhelp1):0
Wed Jun 24 14:32:23 User Exception (shellhelp1) exec failed
terminate called after throwing an instance of 'mongo::UserException'
what(): (shellhelp1) exec failed
Wed Jun 24 14:32:23 mongo got signal 6 (Aborted), stack trace:
Wed Jun 24 14:32:23 0x8056acd 0xb7f0c400 0xb7f0c430 0xb7b2c8a0 0xb7b2e268 0xb7ea9778 0xb7ea7655 0xb7ea7692 0xb7ea77ca 0x8080e43 0x808ee1a 0x80587e8 0xb7b17685 0x8056401
mongo(_Z12quitAbruptlyi+0x43d) [0x8056acd]
[0xb7f0c400]
[0xb7f0c430]
/lib/tls/i686/cmov/libc.so.6(gsignal+0x50) [0xb7b2c8a0]
/lib/tls/i686/cmov/libc.so.6(abort+0x188) [0xb7b2e268]
/usr/lib/libstdc++.so.6(ZN9gnu_cxx27_verbose_terminate_handlerEv+0x158) [0xb7ea9778]
/usr/lib/libstdc++.so.6 [0xb7ea7655]
/usr/lib/libstdc++.so.6 [0xb7ea7692]
/usr/lib/libstdc++.so.6 [0xb7ea77ca]
mongo [0x8080e43]
mongo [0x808ee1a]
mongo [0x80587e8]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb7b17685]
mongo [0x8056401]



 Comments   
Comment by Eliot Horowitz (Inactive) [ 30/Jul/09 ]

closed since resolved and no activity in 2 weeks.
re-open if still issues.

Generated at Thu Feb 08 02:53:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.