Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/hex/src/data/deps.ts>mongo.CreateUserOptions

An ecosystem delivering practices, philosophy and portability.
Go to Latest
interface mongo.CreateUserOptions
import { type mongo } from "https://deno.land/x/hex@0.5.15/src/data/deps.ts";
const { CreateUserOptions } = mongo;

Properties

optional
username: string

The name of the new user.

optional
password: string

The user’s password. The pwd field is not required if you run createUser on the $external database to create users who have credentials stored externally to MongoDB.

optional
customData: Document

Optional. Any arbitrary information. This field can be used to store any data an admin wishes to associate with this particular user. For example, this could be the user’s full name or employee id.

optional
roles: (string | { role: string; db: string; })[]

The roles granted to the user. Can specify an empty array [] to create users without roles.

optional
digestPassword: boolean

Optional. Indicates whether the server or the client digests the password. See https://docs.mongodb.com/manual/reference/command/createUser/#dbcmd.createUser

optional
writeConcern: Document

Optional. The level of write concern for the creation operation. The writeConcern document takes the same fields as the getLastError command.

optional
authenticationRestrictions: Document[]

Optional. The authentication restrictions the server enforces on the created user. Specifies a list of IP addresses and CIDR ranges from which the user is allowed to connect to the server or from which the server can accept users.

optional
mechanisms: ("SCRAM-SHA-1" | "SCRAM-SHA-256")[]

Optional. Specify the specific SCRAM mechanism or mechanisms for creating SCRAM user credentials.

optional
comment: Document

Optional. A user-provided comment to attach to this command.