0.0.7 • Published 8 years ago

xqcore-mongodb v0.0.7

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

XQNode MongoDB module

Usage

    //Set default db connection
    require('xqnode-mongodb').conf = {
        "host": "myhost.tld",
        "port": 17027,
        "dbname": "mydb"
    };

    //Create a MongoDB Model
    var Model = require('xqnode-mongodb').Model;
    var model = new Model({
        collection: 'myCollection'
    });

Methods

fetch() Gets a model from DB and sets data to model sync() To be called everytime the model changes its data Thorws an db.error handler if something wents rong with the database