Wednesday, March 20, 2013

The Best Part of Couchdb

When you finally get some data in your database, you can use the best feature of the couch web  app. That is the map and reduce functions. In the first post I had you write a map function for the first script. That is all well and good, but with the web interface you can write functions to your heart's content and get immediate feedback. A good source to start this can be found in the Couchdb definitive guide, Cookbook for SQL jockeys chapter. I seem to refer to this every now and then, if I have not used Couch for a few weeks.

Instant gratification while working with a database! Who could ask for more?
 A quick overview:
If you have a dataview you can call it up  in the web interface.  From here you can see the result of your query.

To view the code for the view, click the 'View Code' arrow on the left side of the windo

Here you can see the code and mess around with it

 Your results will show in the window below after you hit the run button. If you like it, use the save as or save buttons. If you use Temporary view, you pretty much have a blank slate. But do save this when you are done, temporary functions really don't work well in the programming.

No comments: