Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ export class Admin {
* @param username - The username for the new user
* @param passwordOrOptions - An optional password for the new user, or the options for the command
* @param options - Optional settings for the command
* @deprecated Use the createUser command in `db.command()` instead.
* @see https://www.mongodb.com/docs/manual/reference/command/createUser/
*/
async addUser(
username: string,
Expand Down
2 changes: 2 additions & 0 deletions src/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,8 @@ export class Db {
* @param username - The username for the new user
* @param passwordOrOptions - An optional password for the new user, or the options for the command
* @param options - Optional settings for the command
* @deprecated Use the createUser command in `db.command()` instead.
* @see https://www.mongodb.com/docs/manual/reference/command/createUser/
*/
async addUser(
username: string,
Expand Down
10 changes: 8 additions & 2 deletions src/operations/add_user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import { Callback, emitWarningOnce, getTopology } from '../utils';
import { CommandOperation, CommandOperationOptions } from './command';
import { Aspect, defineAspects } from './operation';

/** @public */
/**
* @public
* @deprecated Use the createUser command directly instead.
*/
export interface RoleSpecification {
/**
* A role grants privileges to perform sets of actions on defined resources.
Expand All @@ -20,7 +23,10 @@ export interface RoleSpecification {
db: string;
}

/** @public */
/**
* @public
* @deprecated Use the createUser command directly instead.
*/
export interface AddUserOptions extends CommandOperationOptions {
/** Roles associated with the created user */
roles?: string | string[] | RoleSpecification | RoleSpecification[];
Expand Down