Skip to main content
Archived

CouchDB reader option to read from view

Related products:FME Form
  • March 17, 2020
  • 0 replies
  • 16 views

cnieman
Contributor
Forum|alt.badge.img+8

It would be useful to be able to configure the CouchDB reader to read from a view using a startkey and endkey to limit the returned documents. Since we have views in the database for other uses, it would be convenient to be able to query the views directly from FME instead of having to return all documents from the database and filter them.

For example, a database with a view where the keys are built from a retailer name and unix timestamp. The view design document looks something like this:

function (doc) {   // code for only returning the subset of documents this view is for.   // E.g. maybe this view is only for returning sale records   if (doc.type != 'sale'){     return;   }   // output the view keys and values   emit([doc.retailer, (new Date(doc.createddate)).getTime()], doc); }

I am getting around this currently using the CouchDB http API and an HTTPCaller with the request URL directed to the view and parsing the returned JSON. As shown below, I am getting the records for "retailer1" in the month of February 2020.


This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.