[SERVER-7295] renameCollection wrapper accepts wrong arguments and fails silently Created: 08/Oct/12  Updated: 14/Feb/17  Resolved: 02/Sep/16

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 2.0.6, 2.0.7
Fix Version/s: 3.3.14

Type: Bug Priority: Critical - P2
Reporter: Luciano Issoe Assignee: Matt Cotter
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux


Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Platforms 2016-09-19
Participants:

 Description   

Trying to use renameCollection, I mistakenly mixed the syntax of the renameCollection and the wrapper function db.collection.renameCollection().

I typed > db.source-collection.renameCollection(

{ to : "target-collection", dropTarget : true }

)

And then, the "source-collection" disappeared, and a new one appeared and is listed as "[object Object]" with db.getCollectionNames().

Apparently the collection was renamed after the first argument of the wrapper.



 Comments   
Comment by Githook User [ 02/Sep/16 ]

Author:

{u'username': u'Machyne', u'name': u'Matt Cotter', u'email': u'matt.cotter@mongodb.com'}

Message: SERVER-7295 check arguments to rename collection helper
Branch: master
https://github.com/mongodb/mongo/commit/03b26cf2e15deb65326f7be7d0b5a94f7ca5471c

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