1.0.1 • Published 7 years ago

mongo-co v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Description

Let mongodb drive supportgenerator

Install the module

npm install mongo-co --save

Instructions

config

KEYvalue
urlConfigRequired fields --object:{host: '127.0.0.1', port: 27017}/Array:{host: '127.0.0.1', port: 27017}, {host: '127.0.0.1', port: 27018}
usernameDo not have to fill in
passwordDo not have to fill in
dbnameDo not have to fill in
replicaSetDo not have to fill in
authMechanismDo not have to fill in
authSourceDo not have to fill in
sslDo not have to fill in

More database connection parameter details......

CONNECT

const mongo = require('mongo-co');
const co = require('co');
const config = ...;
co(function * () {
  try {
    const connectDB = yield mongo(config);
    const menus = connectDB.getQuery('menus');
    const list = yield menus.find();
    console.log('list:', list);
    }
});

Please refer to lib......