Create a new Admin instance (INTERNAL TYPE, do not instantiate directly)
Add a user to the database.
Name Type Descriptionusername
string
The username.
password
string
The password.
options
object optional
Optional settings.
Name Type Default Descriptionw
number | string optional
Deprecated The write concern. Use writeConcern instead.
wtimeout
number optional
Deprecated The write concern timeout. Use writeConcern instead.
j
boolean false optional
Deprecated Specify a journal write concern. Use writeConcern instead.
fsync
boolean false optional
Deprecated Specify a file sync write concern. Use writeConcern instead.
writeConcern
object | WriteConcern optional
Specify write concern settings.
customData
object optional
Custom data associated with the user (only Mongodb 2.6 or higher)
roles
Array.<object> optional
Roles associated with the created user (only Mongodb 2.6 or higher)
session
ClientSession optional
optional session to use for this operation
callback
Admin~resultCallback optional
The command result callback
Retrieve the server information for the current
instance of the db client
options
Object optional
optional parameters for this operation
Name Type Descriptionsession
ClientSession optional
optional session to use for this operation
callback
Admin~resultCallback optional
The command result callback
Execute a command
Name Type Descriptioncommand
object
The command hash
options
object optional
Optional settings.
Name Type DescriptionreadPreference
ReadPreference | string optional
The preferred read preference (ReadPreference.PRIMARY, ReadPreference.PRIMARY_PREFERRED, ReadPreference.SECONDARY, ReadPreference.SECONDARY_PREFERRED, ReadPreference.NEAREST).
maxTimeMS
number optional
Number of milliseconds to wait before aborting the query.
callback
Admin~resultCallback optional
The command result callback
List the available databases
Name Type Descriptionoptions
object optional
Optional settings.
Name Type Default DescriptionnameOnly
boolean false optional
Whether the command should return only db names, or names and size info.
session
ClientSession optional
optional session to use for this operation
callback
Admin~resultCallback optional
The command result callback.
Ping the MongoDB server and retrieve results
Name Type Descriptionoptions
Object optional
optional parameters for this operation
Name Type Descriptionsession
ClientSession optional
optional session to use for this operation
callback
Admin~resultCallback optional
The command result callback
Remove a user from a database
Name Type Descriptionusername
string
The username.
options
object optional
Optional settings.
Name Type Default Descriptionw
number | string optional
Deprecated The write concern. Use writeConcern instead.
wtimeout
number optional
Deprecated The write concern timeout. Use writeConcern instead.
j
boolean false optional
Deprecated Specify a journal write concern. Use writeConcern instead.
fsync
boolean false optional
Deprecated Specify a file sync write concern. Use writeConcern instead.
writeConcern
object | WriteConcern optional
Specify write concern settings.
session
ClientSession optional
optional session to use for this operation
callback
Admin~resultCallback optional
The command result callback
Get ReplicaSet status
Name Type Descriptionoptions
Object optional
optional parameters for this operation
Name Type Descriptionsession
ClientSession optional
optional session to use for this operation
callback
Admin~resultCallback optional
The command result callback.
Retrieve the server information for the current
instance of the db client
options
Object optional
optional parameters for this operation
Name Type Descriptionsession
ClientSession optional
optional session to use for this operation
callback
Admin~resultCallback optional
The command result callback
Retrieve this db's server status.
Name Type Descriptionoptions
Object optional
optional parameters for this operation
Name Type Descriptionsession
ClientSession optional
optional session to use for this operation
callback
Admin~resultCallback optional
The command result callback
Validate an existing collection
Name Type DescriptioncollectionName
string
The name of the collection to validate.
options
object optional
Optional settings.
Name Type Descriptionbackground
boolean optional
Validates a collection in the background, without interrupting read or write traffic (only in MongoDB 4.4+)
session
ClientSession optional
optional session to use for this operation
callback
Admin~resultCallback optional
The command result callback.
The callback format for results
Name Type Descriptionerror
MongoError
An error instance representing the error during the execution.
result
object
The result object if the command was executed successfully.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4