With the vanilla java MongoClient you can specify a read concern for a particular query for example like this:
var result = mongoClient.getDatabase("somedb")
.getCollection("collection")
.withReadConcern(ReadConcern.MAJORITY)
.find(..)
But I cannot seem to find a way to set the ReadConcern using Spring's MongoTemplate. Preferably I'd like to set it for a specific query, but if this is not possible I'm fine with configuring something equivalent to a WriteConcernResolver (but for read concerns).
Is this possible, and if so how?
I'm using spring-data-mongodb version 3.2.6.