[SERVER-1061] Make renameCollection command not admin-only Created: 28/Apr/10 Updated: 12/Jul/16 Resolved: 25/May/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Usability |
| Affects Version/s: | None |
| Fix Version/s: | 1.9.1 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Mathias Stearn | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Comments |
| Comment by Robert Kennington [ 21/Aug/12 ] |
|
To clarify for the novice user as it took a while for me to digest what this FIX means, a non-admin user can rename a collection if it is not sharded. And, this ONLY applies to sharded and unsharded databases that have been administratively locked. However, unlike the user friendly db.<collection name>.drop() command, this requires execution of an administrative command as follows: > use <database name> > db.auth('<username>','<password>') ) { "ok" : 1 }> See http://docs.mongodb.org/manual/reference/commands/#renameCollection for further details. Note: the renameCollection command db.<old collection name>.renameCollection('<new collection name>') still only works for admin users in a locked database. So, you must switch (i.e. use admin) and authenticate as an administrative user to use this command. |
| Comment by auto [ 25/May/11 ] |
|
Author: {u'login': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: renameCollection should only require auth on source and dest DBs, not admin Still technically an admin command and requires running against admin db |
| Comment by Eliot Horowitz (Inactive) [ 13/May/11 ] |
|
We should make the api the same, just make it smart about authentication. |