1.0.23 • Published 9 years ago

bus-mongo v1.0.23

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

BUS-MONGO

BUS-MONGO is a mongodb client, it is more easy-to-use than mongodb-native, and more flexable than mongoose.

Documentation

BUS-MONGO documents

Installation

$ npm install bus-mongo

Stability

current stable branch is master.

Overview

init

firstly ,we need to connect mongodb with the url.

var bus_mongo = require('bus-mongo');
var my_db = bus_mongo.init('mongodb://username:password@localhost:port/my_db');

if you have replicated sets, just add in url

var bus_mongo = require('bus-mongo');
var my_db = bus_mongo.init('mongodb://username:password@master-server:port, mongodb://username:password@slave-server:port/my-db-name');

get db

we can access the other db object after connect to the admin db of mongo

var my_db = bus_mongo.db('my-db-name');

get collection

we can access the collection of the db object.

var my_collection = my_db.collection('collection-name');

crud

we can do all the crud operations of the collection, for example:

my_collection.insert({test:1}, function(err){
    if(err) console.log(err);
    else console.log('success insert!');
});

more operations's docs in here

1.0.23

9 years ago

1.0.21

10 years ago

1.0.20

10 years ago

1.0.19

10 years ago

1.0.18

10 years ago

1.0.17

10 years ago

1.0.16

10 years ago

1.0.15

10 years ago

1.0.14

10 years ago

1.0.13

10 years ago

1.0.12

10 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago