<div dir="ltr">Hi,<div><br></div><div>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 [1] 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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>a) Removing all documents in a CouchDB database</div><div><br></div><div>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.</div>
<div><br></div><div>Another option would be to delete the database-store. This seems to be the worst solution since the documents history will be permanently lost.</div><div><br></div><div>Any ideas?</div><div><br></div><div>
b) Filtering</div><div><br></div><div>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. </div>
<div><br></div><div>Any ideas about filtering and the proper way to be implemented?</div><div><br></div><div>Thanks,</div><div>Tolis</div><div><br></div><div>[1]: <a href="https://github.com/tolis-e/aerogear-js/commit/0cf952c36ea0f31aec2a6732d89eb469fd4a3d09">https://github.com/tolis-e/aerogear-js/commit/0cf952c36ea0f31aec2a6732d89eb469fd4a3d09</a></div>
</div>