-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
txmongo.collection.Collection#rename() without admin DB #204
Comments
Hi, I've just checked if txmongo's According to the docs, If you look into the source code of REPL's
Please check what roles does your DB user have and correct me if I'm wrong. |
So I am using a user with |
Sorry, but I can't reproduce the issue. I tried as follows:
from twisted.internet.task import react
from twisted.internet import defer
from txmongo.connection import ConnectionPool
@defer.inlineCallbacks
def main(reactor):
conn = ConnectionPool('mongodb://test:test@localhost/test')
yield conn.test.qwe.insert({'x': 42})
yield conn.test.qwe.rename('rty')
result = yield conn.test.rty.find()
print result
yield conn.disconnect()
react(main) It printed
They are actually the same: first one is the low-level DB command, second one is Mongo Shell's wrapper written in JavaScript. I've cited its source code above and you can see that it simply runs underlying Could you please try to reproduce the issue on a clean database and publish DB's user accounts setup and testing code? |
Hi there,
I was trying to use
txmongo.collection.Collection#rename()
with a user without admin permissions. This can be done in Mongo just fine without admin permissions, as you can dodb.collection.renameCollection()
within a db you have rw permissions from in the mongo repl. Looking at the source fortxmongo.collection.Collection#rename()
, it does an admin command by default. Can this be switched to use the non-admin one by default and perhaps a flag for the admin version or a different method?The text was updated successfully, but these errors were encountered: