Support configuring default DurabilityLevel, PersistTo, ReplicateTo values
In our organization it's rare that we require specific durability per document, typically it's the same across all our documents and even projects.
It would be nice if we could drive this by a configuration property in application.properties, though I expect Spring Boot to actually contain that logic via CouchbaseDataProperties, but it would be nice if Spring Data Couchbase exposed a way to supply these values.
Building on this, there is also no current way to specify the durability for a Repository#save call.
To reinforce the configurability requirement above, when testing locally developers typically have a single node cluster, but when deploying in production you want to ensure that data hits more than a single node. This may preclude using an annotation on the Repository level. Unless it reads configuration via a SpEL expression.
Starting in spring-data-couchbase-4.3.0-M2 repository.withOptions(Upsert/ReplaceOptions).save(...) will be supported. Similarily for template : couchbaseTemplate.findById(Airport.class).withOptions(getOptions).one(id);
Should be here by the end of the week:
https://repo.spring.io/artifactory/libs-milestone-local/org/springframework/data/spring-data-couchbase/4.3.0-M2/spring-data-couchbase-4.3.0-M2.jar
https://repo.spring.io/ui/repos/tree/General/libs-milestone
Annotations could be added in the future (similar to ScanConsistency) - on methods, repository and entity.
Durability annotation to be added in the same places as ScanConsistency.