spring-data-couchbase
spring-data-couchbase copied to clipboard
Support PersistTo, ReplicateTo and DurabilityLevel attributes on Document annotation.
Hello
In some operationSupport, the values of PersistTo, ReplicateTo or DurabilityLevel are not configurable and the value NONE is always being used.
https://github.com/spring-projects/spring-data-couchbase/blob/34f96018350cb1d1d556d56981df738749bf59a7/src/main/java/org/springframework/data/couchbase/core/ReactiveReplaceByIdOperationSupport.java#L45-L50
https://github.com/spring-projects/spring-data-couchbase/blob/62feffa89d2264e1fdfdb9913703f4f106a7d60b/src/main/java/org/springframework/data/couchbase/core/ReactiveRemoveByIdOperationSupport.java#L49-L54
Is there any plan to support these values?
Thank you very much in advance
All the options are set with the fluent APIs. Just look a little further down that class at the two withDurability() methods.
https://github.com/spring-projects/spring-data-couchbase/blob/34f96018350cb1d1d556d56981df738749bf59a7/src/main/java/org/springframework/data/couchbase/core/ReactiveReplaceByIdOperationSupport.java#L129
https://github.com/spring-projects/spring-data-couchbase/blob/34f96018350cb1d1d556d56981df738749bf59a7/src/main/java/org/springframework/data/couchbase/core/ReactiveReplaceByIdOperationSupport.java#L136
Hi @mikereiche Thank you very much for your quick response.
To use the fluent methods you mentioned, I would have to define the methods myself in my own repository (which is the approach I am taking).
My question/suggestion is that if SimpleReactiveCouchbaseRepository
could take into account replicationPolicies by document type in methods like save
, deleteById
or delete
and consequently ReactiveCouchbaseTemplate
also take into account those values and use the fluent methods like withDurability
you have commented.
This way, it would be transparent to the developer.
Thank you
could take into account replicationPolicies by document type
So you're asking to add an attribute to the @Document annotation. (like Expiry). We can do that.