wheelhouse-couch
A wheelhouse package for using Backbone server side with flatiron. This sets Couch as the data store for the server and is largely a rewrite of backbone-couch. CouchDB communication is via the excellent cradle CouchDB library.
Usage
var flatiron = app = flatironapp dbPlugin = appappappstart8999
After using the plugin, Backbone.sync
is overridden to use CouchDB on the server.
appconfigappconfigappconfig// …
Important note:
Your models should override the default id
attribute to use _id
.
var model = BackboneModel
tests
The grunt way
You must have grunt-cli installed: sudo npm i -g grunt-cli
npm test
You'll need to have a user on your db with the username test
and the password test
.
The Mocha way
mocha test/specs -ui bdd
Changelog
0.4.4
security fix it is no longer possible to bypass the delete method by manually setting isDeleted: true
0.4.3
Updated publish process.
0.4.2
Send updatedAt
and createdAt
back out when they're modified.
0.4.1
Publish error
0.4.0
- breaking change (kinda) no longer automatically reading options from
app.config.get('db')
(this never really was operational anyway) - update the
backbone/collection
view to only look at ids with a/
in them… for performance. - Add unit tests
- Updates retry on a document update conflict
- fix error callbacks. They now return just the response … which is as Backbone intended.
- many methods were private before. They're now exposed in
.internals
- changes feed now removes attributes from the model that were deleted in the db
- the delete method is now much smarter… by just re-implementing the update method
- new
createdAt
andupdatedAt
are now automatically created and updated.
0.3.10
- on db update error, don't log the input. It leads to log pollution.
0.3.9
- pass
notOriginal
for changes feed upates. This enables ignoring of events on changes that are triggered on another server.
formerly known as flatiron-couch-backbone