Client connected to MongoDB

Parameters
options (object) for the new connection
Example
const client = new Client({db: 'example'})

collection

Create a new collection instance of the given name

collection(name: string)
Parameters
name (string) of the collection
Example
const collection = client.collection('foo')

open

Open connection to db and return collection of provided name

open(name: string): Promise
Parameters
name (string) of the collection to open up connection to in db
Returns
Promise: collection instance

close

Close the connection to database

close(): boolean
Returns
boolean: success of closing the connection
Example
client.close()

Collection

Represents a a collection in MongoDB

new Collection(client: any, name: any)
Parameters
client (any)
name (any)
Instance Members
find(doc, options)
save(doc)
count(doc)
update(doc, data, options)
remove(doc)