[aerogear-dev] aerogear-js CouchDB data-manager adapter
tolisemm at gmail.com
Mon May 26 02:40:20 EDT 2014
I have started working on creating a CouchDB data-manager adapter which
uses the CouchDB REST API. The open-create database, read and save
operations are implemented  and tested both with encryption settings and
without encryption settings. If you'd like to give it a try, make sure that
you have enabled CORS on CouchDB side.
The remaining functions that needs to be implemented are remove and filter.
In addition, in order to keep consistent the data-manager API, we should
provide a way to remove all the documents in a CouchDB database-store.
a) Removing all documents in a CouchDB database
I'm thinking of fetching all the docs, using _all_docs endpoint which
returns _id and _rev (revision), mark them as _deleted and use the bulk
insert/update API to delete them. Not sure if this is a proper solution
since there might be a huge number of documents.
Another option would be to delete the database-store. This seems to be the
worst solution since the documents history will be permanently lost.
AFAIK, in order to perform filtering in a CouchDB database, a design
document and an appropriate view has to be created. My thought is that the
AGJS adapter should not create the view, instead we should assume that the
user has created the appopriate views and provide a setting in AGJS where
the view endpoint URl can be set.
Any ideas about filtering and the proper way to be implemented?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the aerogear-dev