create_mongodb

Exceptions

MongodError

Common base class for all non-exit exceptions.

Functions

cli()

create_admin_user(host, password[, port, username])

create_or_update_user(db, username, password, roles)

create_read_only_user(host, password[, port, username])

main(dbpath, admin_password, reader_password[, host, ...])

start_mongod(dbpath, logpath[, host, port, auth])

stop_mongod(dbpath)

Module Contents

exception create_mongodb.MongodError[source]

Bases: Exception

Common base class for all non-exit exceptions.

create_mongodb.cli()[source]
create_mongodb.create_admin_user(host: str, password: str, port: int | None = None, username: str = 'admin')[source]
create_mongodb.create_or_update_user(db: pymongo.database.Database, username: str, password: str, roles: list)[source]
create_mongodb.create_read_only_user(host: str, password: str, port: int | None = None, username: str = 'reader')[source]
create_mongodb.main(dbpath: pathlib.Path, admin_password: str, reader_password: str, host: str = 'localhost', port: int | None = None, admin_username: str | None = 'admin', reader_username: str | None = 'reader')[source]
create_mongodb.start_mongod(dbpath: pathlib.Path, logpath: pathlib.Path, host: str = 'localhost', port: int | None = None, auth: bool = False)[source]
create_mongodb.stop_mongod(dbpath: pathlib.Path)[source]