machdb

1.0.0 • Public • Published

MachDB Build Status Dependency Status devDependency Status

Quick and easy to use database.

Example Usage

var db = require('machdb')('mongodb://localhost:27017/myproject');
db('money')
  .set('phil', 10)
  .set('some_user', db('money').get('phil') + 10);
db('seen').set('some_user', Date.now());
db('posts').set('posts', [
  { title: 'OriginDB is awesome!', body: '...', likes: 10 },
  { title: 'flexbility ', body: '...', likes: 3 },
  { title: 'something someting something', body: '...', likes: 8 }
]);

Database uses MongoDB to store data:

{
    "_id" : ObjectId("567e4741b09bffce48aa98b1"),
    "name" : "money",
    "data" : "{\"phil\":10,\"some_user\":20}"
}
{
    "_id" : ObjectId("567e4741b09bffce48aa98b2"),
    "name" : "seen",
    "data" : "{\"some_user\":1451116353687}"
}
{
    "_id" : ObjectId("567e4741b09bffce48aa98b3"),
    "name" : "posts",
    "data" : "{\"posts\":[{\"title\":\"OriginDB is awesome!\",\"body\":\"...\",\"likes\":10},{\"title\":\"flexbility \",\"body\":\"...\",\"likes\":3},{\"title\":\"something someting something\",\"body\":\"...\",\"likes\":8}]}"
}

Installation

$ npm install machdb --save

Documentation

MachDB shares the same API as OriginDB. The difference between the two, is that MachDB stores data in MongoDB and OriginDB stores data in files. The purpose of MachDB is to store data in PaaS like Heroku or OpenShift.

LICENSE

MIT

Package Sidebar

Install

npm i machdb

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • creaturephil