Skip to content

Commit 1cd46d0

Browse files
committed
CBBucket: Add an overload CBBucket.counter that take expiry param
1 parent 3d240db commit 1cd46d0

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

core/src/main/scala/com/sandinh/couchbase/CBBucket.scala

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,19 @@ final class CBBucket(val underlying: AsyncBucket, val cluster: AsyncCluster) {
607607
): Future[CounterResult] =
608608
defaultCol.binary.increment(id, delta, IncrementOptions(Some(initial)))
609609

610+
/** See doc of the other overload method */
611+
def counter(
612+
id: String,
613+
delta: Long,
614+
initial: Long,
615+
expiry: Duration
616+
): Future[CounterResult] =
617+
defaultCol.binary.increment(
618+
id,
619+
delta,
620+
IncrementOptions(Some(initial), expiry = expiry)
621+
)
622+
610623
/** Add bytes to the end of a Couchbase binary document.
611624
*
612625
* $OnlyBinary

0 commit comments

Comments
 (0)