Closed warownia1 closed 4 years ago
If passed a string, strip database name and pass the rest directly to the pymongo.MongoClient
host, dbname = hostname.rsplit('/', 1)
database = MongoClient(host)[dbname]
Closed by e0ff034758b55642a371b5c20e60059c7cec1ed3
Since multiple separate Slivka instances may use the same database, it's necessary to specify the database name for each project individually instead of hard-coded "slivkadb".
Options include:
mongodb://[username:password@]host[:port][/database]
Very strict and unambiguous, but hard to use.mongodb:\/\/(?:([%\w]+):(.*)@)?([\w./]+(?::\d+)?)\/(\w+)
Easier to use, but may produce ambiguous results if uname or password contains special characters.