How to get the latest document using datetime?
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,