When using Spring Boot defaults with Couchbase, then Couchbase operations are affected by the ObjectMapper that gets configured by Spring Boot causing driver failures. Something like:
com.couchbase.client.core.error.CouchbaseException: query did not project __id. Either use #{#n1ql.selectEntity} or project __id and __cas : SELECT META(`travel-sample`).id AS __id, META(`travel-sample`).cas AS __cas, `name`, `iata`, `icao`, `callsign`, `country` FROM `travel-sample` WHERE `_class` = "example.springdata.couchbase.model.Airline"
Couchbase driver requires a specific Jackson Module to be registered that is shipped with the driver (com.couchbase.client.java.json.JsonValueModule) so that Couchbase's JsonObject and JsonArray can be used for JSON exchange.
I'd recommend improving the arrangement by registering JsonValueModule when Couchbase is on the classpath and when JacksonClusterEnvironmentBuilderCustomizer is used.
/cc @mikereiche
When using Spring Boot defaults with Couchbase, then Couchbase operations are affected by the
ObjectMapperthat gets configured by Spring Boot causing driver failures. Something like:Couchbase driver requires a specific Jackson Module to be registered that is shipped with the driver (
com.couchbase.client.java.json.JsonValueModule) so that Couchbase'sJsonObjectandJsonArraycan be used for JSON exchange.I'd recommend improving the arrangement by registering
JsonValueModulewhen Couchbase is on the classpath and whenJacksonClusterEnvironmentBuilderCustomizeris used./cc @mikereiche