3

Is there a way we can get a document's creation date in Couchbase (2.2.0).

We are currently not storing creation date in our documents, so wanted to know if couch stores that as part of document meta data.

We plan to query documents based on time, and currently the only option that we think will work is to change the server code to store additional creation date field as part of the document itself.

2

Couchbase does not track the created date in the meta-data of an object. You would have to add this to your application to add to each document.

2

It is not tracked but if you have not modified the document since create you can use the CAS value (as of version 4.6), converted to a timestamp.

e.g. using N1QL: SELECT meta().cas/1000000000 ... -> gives seconds

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.