Stephen Russett

Results 312 comments of Stephen Russett

Building on this further: from https://github.com/immutables/immutables/issues/456#issuecomment-253646413 where Optional fields does not appear to be supported for Spring Data Mongo.

@elucash from my testing and understanding, this really only works for the top level document. The moment you want to nest a existing immutable (which may have other nested immutables),...

@asereda-gs if we can get it into a bsonDocument, what are you thinking as a solution?

@asereda-gs here is a way to get BsonDocument and the reader using Spring Data as the example: ```java Document doc = template.findById(id, Document.class, "tenants"); BsonDocument bDoc = doc.toBsonDocument(BsonDocument.class, template.getDb().getCodecRegistry()); BsonDocumentReader...

OKay!!! We are making progress here 🚨 see comments below for better usage ```java Document doc = template.findById(id, Document.class, "tenants"); BsonDocument bDoc = doc.toBsonDocument(BsonDocument.class, template.getDb().getCodecRegistry()); try { Class c =...

Okay here is a update Generic method for use with MongoTemplate. There is still cleanup and validation, but the general usage appears to be functional. ```java import com.google.gson.Gson; import com.google.gson.GsonBuilder;...

With a little bit of tinkering, might be able to set this up set there is a Spring Mongo Converter that will run for all and detect the "type" based...

With the above setup here is a example of being able to fully take advantage of Spring Data for Mongo and Immutables: Using Mongo Aggregations and Lookup queries ```java public...

@elucash can BsonReader (or a parent method/class) us both Gson Type adapters and Jackson mappings in a single Deserilization from BSON into Immutable? Example being you have A Mongo Document...

@elucash this is great stuff! Continually impressed with Immutables lib! A usage detail i am noticing with your setup: When we use Spring to convert from Immutable to Mongo document...