1.2.0 • Published 1 year ago

@sqrtthree/mongos v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

mongos

An opinionated mongoose wrapper.

Install

npm install @sqrtthree/mongos

Usage

import Mongos from '@sqrtthree/mongos'

const mongo = new Mongos(dbConfig: DBConfig, config?: Config, connectOptions?: ConnectOptions)

mongo.connection.model('User', userSchema)

Options

DBConfig: Object

The Object will be formatted to Standard Connection String Format string with sqrthree/mongoose-helper.

Config.lazyConnect: boolean

By default, When a new Mongos instance is created, it will connect to MongoDB server automatically. If you want to keep the instance disconnected until call connect manually, you can pass the lazyConnect option to the true.

Config.logger: Object

A logger used to output event messages.

ConnectOptions

See mongoosejs.com/docs/connections.html#options to get more details.


sqrtthree.com  ·  GitHub @sqrthree  ·  Twitter @sqrtthree

1.2.0

1 year ago

1.1.0

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.0

3 years ago