0.0.3 • Published 4 years ago
@tick-core/mongo v0.0.3
tick-core-mongo: mongo client
下载
npm install @tick-core/mongo --save
npm install mongoose --save
npm install @types/mongoose --save
使用
import {
MongoConf,
InitMongo
} from '@tick-core/mongo'
const conf: Record<string, MongoConf> = {
test: {
host: 'xxxxxx',
port: 27017,
db: 'xxx',
username: 'xxx',
password: 'xxxccc'
}
}
const mongo: InitMongo = new InitMongo(conf)
const testClient = await mongo.getClient('test')