node package manager

mini-mongo

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);
});