0.2.22 • Published 9 years ago

backbone-db-mongodb v0.2.22

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

Usage

Build Status

var MongoDB = require('backbone-db-mongodb');
var Model = require('backbone-promises').Model;
var store = new MongoDB(mongoClient);

var MyModel = Model.extend({
  db: store,
  sync: store.sync,
  mongo_collection: 'mymodels'
});

var a = new MyModel({id:"1", "data":123});

a.save().then(function() {
  var b = new Model({id:1});
  return b.fetch().then(function() {
    console.log(a.get("data"),b.get("data"));
  });
}).otherwise(console.error.bind(console));
0.2.22

9 years ago

0.2.20

9 years ago

0.2.19

9 years ago

0.2.18

10 years ago

0.2.17

10 years ago

0.2.16

10 years ago

0.2.15

10 years ago

0.2.14

10 years ago

0.2.13

10 years ago

0.2.12

10 years ago

0.2.11

10 years ago

0.2.10

10 years ago

0.2.9

10 years ago

0.2.8

10 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago