Is there a way where I increment the counter in a document and after that incrementation the value in the document gets decremented after 24 hours automatically?

Hi Swapnil

As David indicated this can also be done via Eventing I invite you to look as another Eventing specific forum post where I posted some code that uses Evening to create a “poor man’s crontab” explaind in the post “How to schedule a query in couchbase to run daily

In the other posts example just replace the code block

// =========================================================
/* BEG ANYTHING YOU WANT HERE (pre 6.5 you have KV ops, for 6.5+ also N1QL AND CURL) will show N1QL */
      
    // decrement once a day, make sure 
    // 1 the BUCKET *mybucket* is aliased as RW in the Eventing function Setup screen (in 6.5+ this can be the src bucket)
    // 2 *some_fixed_key* is the 'id' to retrieve the document that has a field you are incrementing and decrementing.
    //     where the document has a field say 'mycounter' that you want to decrement once daily.  Not this 'id' is not from
    //    the mutation of the timer but form the document you want to actually manipulate.

    var wrk = mybucket[some_fixed_key];
    wrk.mycounter --;
    wrk[some_fixed_key] = wrk;

/* END ANYTHING YOU WANT HERE */
// =========================================================

Cheers