Can i have an automatic reset on couchbase counter doc

I want to reset the value of counter document in couchbase when it reaches certain number.
how can this be achieved?