Skip to content

Commit

Permalink
docs(mongo-memory-server-createuser): add file
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Jun 15, 2022
1 parent e9ad66f commit 00c8e64
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api/interfaces/mongo-memory-server-automaticauth.md
Expand Up @@ -20,7 +20,7 @@ Normally authentication is enabled when the `auth` field a object, but with this
Typings: `extraUsers?: CreateUser[]`
Default: `[]`

Add extra users after the root user has been created, uses [`CreateUser`](TODO).
Add extra users after the root user has been created, uses [`CreateUser`](./mongo-memory-server-createuser.md).

### customRootName

Expand Down
38 changes: 38 additions & 0 deletions docs/api/interfaces/mongo-memory-server-createuser.md
@@ -0,0 +1,38 @@
---
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/nodkz/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/).
1 change: 1 addition & 0 deletions website/sidebars.js
Expand Up @@ -12,6 +12,7 @@ module.exports = {
Interfaces: [
'api/interfaces/mongo-memory-server-opts',
'api/interfaces/mongo-memory-server-automaticauth',
'api/interfaces/mongo-memory-server-createuser',
],
},
guides: {
Expand Down

0 comments on commit 00c8e64

Please sign in to comment.