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

Function _create_user

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

Source from the content-addressed store, hash-verified

1290
1291
1292async def _create_user(authdb, user, pwd=None, roles=None, **kwargs):
1293 cmd = SON([("createUser", user)])
1294 # X509 doesn't use a password
1295 if pwd:
1296 cmd["pwd"] = pwd
1297 cmd["roles"] = roles or ["root"]
1298 cmd.update(**kwargs)
1299 return await authdb.command(cmd)
1300
1301
1302async def 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