We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When I connect to MongoDB using my username password, it throws an error not authorized, is there a configuration problem?
env:
docker run --name mongo-4.2.0 -p 27017:27017 -e MONGO_INITDB_ROOT_USERNAME=username -e MONGO_INITDB_ROOT_PASSWORD=password --restart always -d mongo:4.2.0 Platform macOS-13.3.1-arm64-arm-64bit Python 3.10.8 MongoDB 4.2.0 twisted==21.7.0 txmongo==23.0.0 pymongo==3.13.0
code:
from twisted.internet import defer, reactor from txmongo.connection import ConnectionPool @defer.inlineCallbacks def example(): mongodb_uri = "mongodb://username:password@127.0.0.1:27017/?authMechanism=DEFAULT" mongo = yield ConnectionPool(mongodb_uri) foo = mongo.foo # `foo` database test = foo.test # `test` collection # fetch some documents docs = yield test.find(limit=10) for doc in docs: print(doc) if __name__ == '__main__': example().addCallback(lambda ign: reactor.stop()) example().addErrback(lambda ign: reactor.stop()) reactor.run()
The text was updated successfully, but these errors were encountered:
MongoDB 4.0 and later default sha256 mec,txmongo doesn't seem to support this option
Sorry, something went wrong.
No branches or pull requests
When I connect to MongoDB using my username password, it throws an error not authorized, is there a configuration problem?
env:
code:
The text was updated successfully, but these errors were encountered: