Constructor
new MongoClient(URI)
Constructor - takes a MongoDB URI
Supported URI Format is mongodb+srv://USERNAME:PASSWORD@...
The part after ... should be a DNS name and options but is ignored in the simulato.
In the simulator you can make up a unique username and password for yourself, minimum 6 characters for each.
Parameters:
Name | Type | Description |
---|---|---|
URI |
string | MongoDB Connection Details |
Methods
getDatabase(dbName)
Parameters:
Name | Type | Description |
---|---|---|
dbName |
String |
Returns:
a MongoDatabase Object representing a database you want to work with
(async) hello()
Requests information about the connected cluster
Returns:
server status information
(async) listDatabaseNames()
Lists databases that exist on the server
Returns:
Array of database names as strings