How to get the latest document using datetime?
Mon, 02/18/2013 - 06:42
Hi all,
We store in a couchbase 2.0 different documents and each document has property docDate of datetime. In the application we need to take the latest documents stored in the database and also to make some reports based on time periods. And the questions are:
1) How to store the datetime - as string (ISO) or splited - year, month, day, hours, minutes?
2) How to make a view that returns the latest document? In SQL Select top 1 order by docDate desc?
3) How to make a view to use in reports for time period?
Thanks in advance,
regards,
Ivan
Hello,
It looks like our 2 blog posts are answering the question:
* http://tugdualgrall.blogspot.fr/2013/02/how-to-get-latest-document-by-da... (map function only)
* http://hutgrip.com/blogs/getting-latest-feed-data-from-couchbase-in-nodejs/ (map and reduce)
Regards
Tug
@tgrall