An ember-data
kit for Apache CouchDB. A collection of adapters to work with CouchDB documents, attachments, revisions, and the changes feed. Based off of ember-couchdb-kit by Aleksey Zatvobor.
Version 0.0.2 of this addon is tested to work with Ember 1.13.6 and Ember Data 1.13.7.
ember install ember-couch
In your adapters and serializers you must import then extend the adapter and serializer you wish to use from ember-couch. There are 3 adapters you can extend and 3 serializers you can extend. They are:
- DocumentAdapter
- AttachmentAdapter
- RevAdapter (experimental)
- DocumentSerializer
- AttachmentSerializer
- RevSerializer (experimental)
Example adapter:
import { DocumentAdapter } from 'ember-couch';
export default DocumentAdapter.extend({
host: 'localhost:5984',
db: 'boards'
});
Example serializer:
import { DocumentSerializer } from 'ember-couch';
export default DocumentSerializer.extend();
If you would like to work with the changes feed, just add this statement to the top of your route:
import { ChangesFeed } from "ember-couch";
Some notable features:
- natural
findRecord/createRecord/deleteRecord
functions; - document's attachments designed as
hasMany
relationship; - document's revisions designed as
belongsTo
andhasMany
relationships; - ability to work with
/_changes
feeds;
For other features have a look at our example app located in
tests/dummy/app
See CONTRIBUTING.md
ember-couch
source code is released under MIT-License. Check LICENSE.md for more details.