Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

lowla/lowladb-node-mongo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LowlaDB-Node-Mongo Build Status

A MongoDB Datastore for LowlaDB on Node servers.

Installation

$ npm install lowladb-node-mongo --save

Usage

Construct an instance of MongoDatastore and configure LowlaDB to use it instead of the default datastore.

var app = require('express');
var lowla = require('lowladb-node');
var MongoDatastore = require('lowladb-node-mongo');

var lowlaConfig = {
  datastore: new MongoDatastore({ mongoUrl: 'mongodb://127.0.0.1/lowladb' })
};

lowla.configureRoutes(app, lowlaConfig);

The MongoDatastore constructor takes an optional configuration object. The following options are supported:

{
  // A MongoDB database to use, or falsey to use mongoUrl below instead
  db: false,

  // The Mongo URL to connect to if db was not specified
  mongoUrl: 'mongodb://127.0.0.1/lowladb',

  // Where to send log output
  logger: console
}

About

A MongoDB Datastore for LowlaDB on Node

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors