OpenAg Wiki Archive
Archived Contents from the original OpenAg Wiki (snapshot on Apr 8, 2020)
The archived wiki only includes information up the v3.0 version of the PFC-EDU, and is here for preservation purposes. You can find resources about the latest version of the PFC v4.0 on the Personal Food Computer resources page.
CouchDB Views
As always, refer to the manuals for the best documentation. The easiest way to create views is within CouchDB Futon (the web interface). Click on the mvp_sensor_data database to navigate down into it, then under the menu “View” go to the “temporary view” and create a new one (or edit an existing one). Click on the “View Code” window arrow to drop down the code editing window. The view I created has the following code:
function(doc) {
if(doc.value && doc.attribute && doc.status == 'Success')
{
emit([doc.attribute, doc.name, doc.timestamp], doc);
}
}
The bottom window shows the query results. Click on “Save As” and save it in the _design/doc file as “attribute_value”
This view returns more data than you want, you will use query parameters within the curl http to select subsets of these records.