0.1.1 • Published 8 years ago

mini-mongo v0.1.1

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

mini-mongo

NPM Version

About

Think of mini-mongo vs. mongodb as sqlite vs mysql! mini-mongo is built on top of the superb npm module nedb and adds additional functionality to line up with the mongodb db interface.

Install

npm install mini-mongo

Example

'use strict';

const MiniMongo = require('mini-mongo');

MiniMongo.connect({
  autoload: true,
  directory: './data/'
}, (err, db) => {

  const cats  = db.collection('cats');
  const dogs  = db.collection('dogs');
  const dogs2 = db.collection('dogs2');
  const dogs3 = db.collection('dogs3');

  for (let i = 0; i < 10; i++) {
    cats.insert({label: 'Meow-' + i});
  }
  
  setTimeout(() => {
    db.stats((err, stats) => {
      console.log(err, stats);
    });
  }, 100);
});