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

Function _create_user

test/helpers_shared.py:141–148  ·  view source on GitHub ↗
(authdb, user, pwd=None, roles=None, **kwargs)

Source from the content-addressed store, hash-verified

139
140
141def _create_user(authdb, user, pwd=None, roles=None, **kwargs):
142 cmd = SON([("createUser", user)])
143 # X509 doesn't use a password
144 if pwd:
145 cmd["pwd"] = pwd
146 cmd["roles"] = roles or ["root"]
147 cmd.update(**kwargs)
148 return authdb.command(cmd)
149
150
151def _all_users(db):

Callers

nothing calls this directly

Calls 3

updateMethod · 0.95
SONClass · 0.90
commandMethod · 0.45

Tested by

no test coverage detected