Hi,
What is the process to register a codec for a ReactiveMongoClient?
public class MongoConfig extends AbstractReactiveMongoConfiguration {
@Override
public MongoClient reactiveMongoClient() {
CodecRegistry codecRegistry = CodecRegistries.
fromRegistries(
CodecRegistries.fromCodecs(new OffsetDateTimeStringCodec()),
MongoClients.getDefaultCodecRegistry()
);
ClusterSettings cs = ClusterSettings.builder().hosts(Arrays.asList(new ServerAddress("localhost"))).build();
MongoClientSettings mcs = MongoClientSettings.builder()
.codecRegistry(codecRegistry)
.clusterSettings(cs)
.build();
return MongoClients.create(mcs);
}
...
}
I can add documents to the database, but instead of
OffsetDateTime I see that the persisted object is identified as
Object.
Am I missing something?
Thanks,
Gintas