Files
mongodb-memory-server/docs/api/interfaces/mongo-memory-server-createuser.md
hasezoey 300a4f2670 docs: update links "github.com/nodkz" -> "github.com/typegoose"
github automatically redirects those links, but it is still better the update them
2024-07-13 13:50:15 +02:00

39 lines
1.0 KiB
Markdown

---
id: mongo-memory-server-createuser
title: 'CreateUser'
---
API Documentation of `CreateUser`-Interface
## Values
This Interface inherits most values from the `CreateUserMongoDB` interface, which is a interface for the `createUser` command manually types, see [#663](https://github.com/typegoose/mongodb-memory-server/issues/663) for tracking on switching to native interface.
Because most values are inherited, only the new ones and important ones are described here.
### database
Typings: `database?: string`
Default: `admin`
Set the Database where the user will be added to, by default the user will be added to the `admin` database.
### createUser
Typings: `createUser: string`
Set the username of the User to create.
### pwd
Typings: `pwd: string`
Set the password of the User to create.
### roles
Typings: `roles: ({ role: UserRoles; db: string } | UserRoles)[]`
Set the Roles the new User will have.
For a list of available Roles, see the [MongoDB Documentation](https://www.mongodb.com/docs/manual/reference/built-in-roles/).