Backbone.Mongo

Query your Backbone.Collections with the MongoDB API

This project is glue between...

Run Mongo queries in the browser

You can run mongo queries on your Backbone.Collections, even in your clientside code. Queries run synchronously on a completely in memory implementation of mongo.

Queries

var people = new Backbone.Mongo();

// Use any mongo query you like
var highScorers = people.find({ score: { $gt: 50 }}).fetch();
var obama = people.find({ name: "Barack" }).fetch();

// Inserts and updates work as well
people.insert({ name: "Claire" });
people.update({ name: "Alex" }, { $inc: { score: 10 } });

Test console

$

Query Result