mongo-co

1.0.1 • Public • Published

Description

Let mongodb drive support generator

Install the module

npm install mongo-co --save

Instructions

config

KEY value
urlConfig Required fields --object:{host: '127.0.0.1', port: 27017}/Array:[{host: '127.0.0.1', port: 27017}, {host: '127.0.0.1', port: 27018}]
username Do not have to fill in
password Do not have to fill in
dbname Do not have to fill in
replicaSet Do not have to fill in
authMechanism Do not have to fill in
authSource Do not have to fill in
ssl Do 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......

Readme

Keywords

Package Sidebar

Install

npm i mongo-co

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • haobin