0.0.3 • Published 10 years ago

b_mongom v0.0.3

Weekly downloads
2
License
GNU GPL v3.0
Repository
github
Last release
10 years ago

Simple Mongo Api for Node

Simple Mongo Api, you simply need to have knowledge about the queries in mongodb.

Usage

Connectiong Mongo:

    var mongo = require('b_mongom');
    
    mongo.connectMongo('mongodb://127.0.0.1:27017/my_db', function(db){
        //Mongo Connected
        
        //Setting Collection 
        mongo.collectionSet('collection_name');
        mongo.insert({a:1}, function(){
            //data inserted in collection_name
        })
        
        mongo.collectionSet('collection_two');
        mongo.insert({b:3}, function(){
            //data inserte in collection_two
        })
        
        
        mongo.collectionSet('user_data');
        //Getting information from user_data
        
        mongo.find({name:'Carlos'}, function(array_result){
            //Do something with array_result
        }, 10 (limit optional), {name:1 asc or -1 desc} (sorted optional default 1))
       
        //Remove Juan freom user_data
        mongo.remove({name: 'Juan'})
        
    })
    
    
0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago