Skip to content

Commit b5dc1a2

Browse files
committed
Use scope and collection in transaction in findByQuery.count(). (#1868)
Closes #1862.
1 parent f1df93f commit b5dc1a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/springframework/data/couchbase/core/ReactiveFindByQueryOperationSupport.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,9 @@ public Mono<Long> count() {
256256
: rs.query(statement, opts);
257257
} else {
258258
TransactionQueryOptions opts = buildTransactionOptions(pArgs.getOptions());
259-
return (AttemptContextReactiveAccessor.createReactiveTransactionAttemptContext(s.get().getCore(),
260-
clientFactory.getCluster().environment().jsonSerializer())).query(statement, opts);
259+
JsonSerializer jSer = clientFactory.getCluster().environment().jsonSerializer();
260+
return AttemptContextReactiveAccessor.createReactiveTransactionAttemptContext(s.get().getCore(), jSer)
261+
.query(OptionsBuilder.queryContext(pArgs.getScope(), pArgs.getCollection(), rs.bucketName()) == null ? null : rs, statement, opts);
261262
}
262263
});
263264

0 commit comments

Comments
 (0)