2.0.1 • Published 8 years ago

bentojs-api-mongo v2.0.1

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

npm version GitHub license

Bento.js API Mongo

Installation

$ npm install --save bentojs-api-mongo

Config

Once you have installed and built your API solution you can move into the ./config/mongo directory and set up the default.js settings for your project.

module.exports = {

  /*
   |--------------------------------------------------------------------------------
   | Mongo
   |--------------------------------------------------------------------------------
   */

  mongo : {
    host     : 'localhost',
    port     : 27017,
    database : null,
    force    : false
  }

};

Model

Create your first model by adding them to the models folder of your module.

bento.register.model('Foo', 'mongo', model => {

  model.filter = function(parse, query) {
    return parse(query, {
      where : {
        name : parse.STRING,
        type : parse.STRING
      }
    }, [ 'name', 'type' ]);
  };

  return model;

});
2.0.1

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago

0.0.13

8 years ago

0.0.12

9 years ago

0.0.11

9 years ago