Couchbase
  • Why NoSQL?
  • Couchbase Server
  • Download
  • Resources
  • Careers
Home | Forums | Couchbase | Couchbase Server 2.0

How to get the latest document using datetime?

1 reply [Last post]
  • Login or register to post comments
Mon, 02/18/2013 - 06:42
idragoev
Offline
Joined: 02/18/2013
Groups: None

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

Top
  • Login or register to post comments
Thu, 02/21/2013 - 06:30
tgrall
Offline
Joined: 09/05/2012
Groups: None

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

Top
  • Login or register to post comments
  • Login or register to post comments
  • Login
  • Register

Company

  • About Us
  • Leadership
  • Customers
  • Partners
  • Contact Us

Product

  • Couchbase Server
  • Couchbase SDKs
  • Use Cases
  • Documentation
  • Forums

Open Source

  • Couchbase Project
  • Couchbase vs. CouchDB

Commercial

  • Subscriptions & Support
  • Training & Services

News

  • Blog
  • Newsletter
  • Press Releases
  • Buzz

Follow Us

    
  • Customer Login
  • Terms of Service
  • Privacy Policy
  • Trademark Policy
  • Site Map

© 2013 COUCHBASE All rights reserved.

Sign in to Couchbase Community

close
  • Create new account
  • Request new password
You are logging into the Forums, Wiki and Issue Tracker