This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

b_mongom

0.0.3 • Public • Published

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'})
        
    })
    
    

Readme

Keywords

Package Sidebar

Install

npm i b_mongom

Weekly Downloads

3

Version

0.0.3

License

GNU GPL v3.0

Last publish

Collaborators

  • synapsemedia