From 00c8e641a45526fbdde0e1ba7c83a577ec903d9e Mon Sep 17 00:00:00 2001 From: hasezoey Date: Wed, 15 Jun 2022 12:50:08 +0200 Subject: [PATCH] docs(mongo-memory-server-createuser): add file --- .../mongo-memory-server-automaticauth.md | 2 +- .../mongo-memory-server-createuser.md | 38 +++++++++++++++++++ website/sidebars.js | 1 + 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 docs/api/interfaces/mongo-memory-server-createuser.md diff --git a/docs/api/interfaces/mongo-memory-server-automaticauth.md b/docs/api/interfaces/mongo-memory-server-automaticauth.md index 4e2cf5678..728101901 100644 --- a/docs/api/interfaces/mongo-memory-server-automaticauth.md +++ b/docs/api/interfaces/mongo-memory-server-automaticauth.md @@ -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 diff --git a/docs/api/interfaces/mongo-memory-server-createuser.md b/docs/api/interfaces/mongo-memory-server-createuser.md new file mode 100644 index 000000000..92f4c4bf9 --- /dev/null +++ b/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/). diff --git a/website/sidebars.js b/website/sidebars.js index 040878d3a..385f9f817 100644 --- a/website/sidebars.js +++ b/website/sidebars.js @@ -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: {