I have a process which posts documents similar to the one below to CouchDB:
{"timestamp": [2010, 8, 4, 9, 25, 24], "type": "quote", "bid": 95.0, "offer": 96.5}
Many such documents are posted over the course of a day, each timestamped appropriately.
I want to create a CouchDB view which returns the last quote stored every day.
I've been reading the link below on how to create complex views
http://books.couchdb.org/relax/reference/views-for-sql-jockeys
but I have trouble seeing how to combine map and reduce functions to achieve the desired result [the map function is easy; it's the reduce function I'm having trouble with].
Any pointers gratefully received.