xqcore-mongodb

v0.0.7
MongoDB module for xqcore
xqcore xqcore-node mongo mongodb model

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

npm i xqcore-mongodb

Metadata

  • MIT
  • Whatever
  • Andi Heinkelein
  • released 11/29/2015

Downloads

Maintainers