MongoEngine / flask-mongoengine

MongoEngine flask extension with WTF model forms support
Other
840 stars 255 forks source link

Config `db` cover host info #518

Closed mrxiaozhuox closed 1 year ago

mrxiaozhuox commented 1 year ago

I'm using the URI to connect mongodb, but the URI is from env var, and I cannot change it, the default db is admin. so can I use db to cover the host info?

app.config["MONGODB_SETTINGS"] = {
    "db": "myapp",
    "host": "mongo://localhost:27017/admin",
}

I want this demo use myapp db, not admin.