[SERVER-4845] Problem using $rename on indexed fields Created: 01/Feb/12  Updated: 11/Jul/16  Resolved: 01/Mar/12

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 2.0.2
Fix Version/s: 2.1.1

Type: Bug Priority: Major - P3
Reporter: Daniel Weber Assignee: Aaron Staple
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7


Operating System: ALL
Participants:

 Description   

See my blog post which describe the problem.

http://danielweberonline.wordpress.com/2012/02/01/problem-using-rename-on-indexed-fields-using-mongodb/



 Comments   
Comment by auto [ 01/Mar/12 ]

Author:

{u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}

Message: SERVER-4845 pass through an element when an operator should not be applied
Branch: master
https://github.com/mongodb/mongo/commit/dd4909f631355bf614893cb26de07d46b726af98

Comment by Aaron Staple [ 01/Feb/12 ]

> c.ensureIndex({a:1})
> c.save({b:1})
> c.find()
{ "_id" : ObjectId("4f29a91afffa4b57ab956f96"), "b" : 1 }
> c.update( {}, {$rename:{a:'b'}} )
> c.find()
{ "_id" : ObjectId("4f29a91afffa4b57ab956f96") }

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