Constructor
new MongoDatabase()
Methods
(async) createCollection(collName, options)
Create a new Colleciton in this database - only required when passing additional options like
timeSeries or validator
Parameters:
Name | Type | Description |
---|---|---|
collName |
String | |
options |
Object |
Returns:
Object showing success or failure
(async) drop()
Drop (Remove) this database and all collections inside it.
Returns:
Object showing success or failure
getCollection(collNamne)
Parameters:
Name | Type | Description |
---|---|---|
collNamne |
String |
Returns:
a MongoCollection Object representing a MongoDB colleciton you want to work with
(async) listCollectionNames()
List all existing collections in this database.
Returns:
Array of collection names as Strings.