Details
-
Bug
-
Resolution: Unresolved
-
Major
-
7.0.2
-
None
-
Untriaged
-
1
-
No
Description
We have a single bucket (profiles) with the following scopes/collections/indexes:
{{}}
CREATE SCOPE `profiles`.core CREATE SCOPE `profiles`.configuration
|
CREATE COLLECTION `profiles`.core.user_profile;
|
CREATE COLLECTION `profiles`.configuration.attribute;
|
CREATE PRIMARY INDEX `#primary` ON `profiles`.`configuration`.`attribute`;
|
{{}}
In our tests, we are mutating on profiles.core.user_profile (insert, replace). However, as shown in the picture, we observe that Couchabse sent these mutations to the profiles.configuration.attribute primary index.
We are using Java SDK(reactive API):
@Autowired |
private com.couchbase.client.java.Cluster cluster; |
private static final String SCOPE = "core"; |
private static final String BUCKET = "profiles"; |
|
cluster.reactive().bucket(BUCKET).scope(SCOPE).collection("user_profile") |
.insert(documentId, content, InsertOptions.insertOptions().durability(durability).retryStrategy(retryStrategy))
|
|
cluster.reactive().bucket(BUCKET).scope(SCOPE).collection("user_profile").mutateIn(documentId, mutateInSpec, |
MutateInOptions.mutateInOptions().durability(durability).storeSemantics(StoreSemantics.REPLACE).cas(cas)
|
.retryStrategy(retryStrategy))
|
And Spring repositories for the configuration collections:
@Document
|
@Collection("attribute") |
@Scope("configuration") |
@Data
|
@EqualsAndHashCode(callSuper = true) |
@NoArgsConstructor
|
public class Attribute { |
|
private static final long serialVersionUID = 4195336417156562036L; |
@Id |
private String externalId; |
@Field("name") |
private String name; ... |
}
|
Version
spring-boot-starter-data-couchbase-reactive:2.6.1
Please also note that the same happens if we use the “_default” scope for all collections:
CREATE COLLECTION `profiles`.`_default`.user_profile;
|
CREATE COLLECTION `profiles`.`_default`.attribute;
|
CREATE PRIMARY INDEX `#primary`ON `profiles`.`_default`.`attribute`;
|
@Autowired private ReactiveCouchbaseTemplate template; |
|
template.getCollection("user_profile").reactive().insert(documentId, content, InsertOptions.insertOptions().durability(durability).retryStrategy(retryStrategy)) |
Attachments
Issue Links
- relates to
-
MB-51161 Mutations on a collection reflecting on num_docs_pending of index of another collection
- Open