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

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimongo

A client-side MongoDB implementation which supports basic queries, including some geospatial ones.

Uses code from Meteor.js minimongo package, reworked to support more geospatial queries and made npm+browserify friendly.

Usage

Minimongo is designed to be used with browserify.

// Require minimongo
var minimongo = require("minimongo");

var LocalDb = minimongo.LocalDb;

// Create local db (in memory database with no backing)
db = new LocalDb();

// Add a collection to the database
db.addCollection("animals");

doc = { species: "dog", name: "Bingo" };

// Always use upsert for both inserts and modifies
db.animals.upsert(doc, function() {
	// Success:

	// Query dog (with no query options beyond a selector)
	db.animals.findOne({ species:"dog" }, {}, function(res) {
		console.log("Dog's name is: " + res.name);
	});
});

HybridDb

Queries the local database first and then returns remote data if different than local version.

This approach allows fast responses but with subsequent correction if the server has differing information.

About

Client-side in-memory mongodb backed by localstorage with server sync over http

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages