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

Expiration time of docs with DP4

5 replies [Last post]
  • Login or register to post comments
Tue, 05/08/2012 - 06:54
Pathe
Offline
Joined: 04/23/2012
Groups: None

I just set a key with an expiration time:

client.set('my-sample-expication', JSON.stringify(view), function(error, result) {
    client.close();
    console.log(error, result);
    res.send(200);
}, 60);

In the document it says:

"$expiration": 0

The document gets deleted if requested after the expiration time, so not automatically after 60 seconds?

Top
  • Login or register to post comments
Fri, 06/08/2012 - 11:06
mikew
Offline
Joined: 03/14/2011
Groups:

Document deletion is lazy in Couchbase and there are two ways an item can be deleted after it expires.

1. The first way is the way you mentioned. If you do a get on an expired item then it will be deleted.

2. Couchbase has an expiry pager which periodically iterates through all of the data and looks for expired items. By default this pager run every 60 minutes, but it can be configured to run at different intervals. If you interested in how to change this setting I can provide an example.

Top
  • Login or register to post comments
Fri, 06/08/2012 - 11:52
Pathe
Offline
Joined: 04/23/2012
Groups: None

Thanks, that's good to know!

Top
  • Login or register to post comments
Wed, 06/20/2012 - 17:50
wintrmute
Offline
Joined: 06/19/2012
Groups: None

mikew wrote:
Document deletion is lazy in Couchbase and there are two ways an item can be deleted after it expires.

1. The first way is the way you mentioned. If you do a get on an expired item then it will be deleted.

2. Couchbase has an expiry pager which periodically iterates through all of the data and looks for expired items. By default this pager run every 60 minutes, but it can be configured to run at different intervals. If you interested in how to change this setting I can provide an example.

Hi Mike,
Do you think you could get the documentation updated to reflect that?
From my reading of this page, it sounded like items would only ever be deleted when retrieved..

http://www.couchbase.com/docs/couchbase-manual-1.8//couchbase-developing...

Top
  • Login or register to post comments
Wed, 06/20/2012 - 17:53
mikew
Offline
Joined: 03/14/2011
Groups:

Sure. I will pass this on to our documentation people. Thanks for pointing this out.\

http://www.couchbase.com/issues/browse/MB-5639

Top
  • Login or register to post comments
Fri, 07/13/2012 - 10:44
mikew
Offline
Joined: 03/14/2011
Groups:

The docs have been updated to reflect the information in this forum post.

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