xqcore-mongodb

0.0.7 • Public • Published

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

Package Sidebar

Install

npm i xqcore-mongodb

Weekly Downloads

2

Version

0.0.7

License

MIT

Last publish

Collaborators

  • andi-oxidant
  • andifeind