MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _create_user

Function _create_user

test/__init__.py:1276–1283  ·  view source on GitHub ↗
(authdb, user, pwd=None, roles=None, **kwargs)

Source from the content-addressed store, hash-verified

1274
1275
1276def _create_user(authdb, user, pwd=None, roles=None, **kwargs):
1277 cmd = SON([("createUser", user)])
1278 # X509 doesn't use a password
1279 if pwd:
1280 cmd["pwd"] = pwd
1281 cmd["roles"] = roles or ["root"]
1282 cmd.update(**kwargs)
1283 return authdb.command(cmd)
1284
1285
1286def connected(client):

Callers 2

_init_clientMethod · 0.70
create_userMethod · 0.70

Calls 3

updateMethod · 0.95
SONClass · 0.90
commandMethod · 0.45

Tested by

no test coverage detected