mongodb sync adapter for Backbone resources


a database ambiguous Backbone.sync replacement for Node.js. this allows you to use model instance functions like fetch and save on the server.

$ npm install brainy-sync

true to Backbone.sync, you can override the global sync handler as well as indivudal model sync methods. it is totally transparent- the Backbone API remains identical.

var Sync = require('brainy-sync'),
  Backbone = require('backbone'),
  config = { host: '', port: 5984, name: 'brainy' };
Backbone.sync = Sync('couchdb, config');
var User = Backbone.Model.extend({
  url: '/users',
  sync: Sync('couchdb', config)
var user = new User({
  username: 'catshirt'
  success: function() {