Converts the given object into one Mongo will be able to store natively but retains the type information in case
the given TypeInformation differs from the given object type.
Configures the MongoTypeMapper to be used to add type information to Documents created by the
converter and how to lookup type information from Documents when reading them.
Configures the MongoTypeMapper to be used to add type information to Documents created by the
converter and how to lookup type information from Documents when reading them. Uses a
DefaultMongoTypeMapper by default. Setting this to null will reset the TypeMapper to the
default one.
public void setMapKeyDotReplacement(@NullableString mapKeyDotReplacement)
Configure the characters dots potentially contained in a Map shall be replaced with. By default we don't do
any translation but rather reject a Map with keys containing dots causing the conversion for the entire
object to fail. If further customization of the translation is needed, have a look at
potentiallyEscapeMapKey(String) as well as potentiallyUnescapeMapKey(String).
Parameters:
mapKeyDotReplacement - the mapKeyDotReplacement to set. Can be null.
object - the object to create a DBRef to link to. The object's type has to carry an id attribute.
referringProperty - the client-side property referring to the object which might carry additional metadata for
the DBRef object to create. Can be null.
Returns:
will never be null.
write
public void write(Object obj,
org.bson.conversions.Bson bson)
Root entry method into write conversion. Adds a type discriminator to the Document. Shouldn't be called for
nested conversions.
Adds custom type information to the given Document if necessary. That is if the value is not the same as
the one given. This is usually the case if you store a subtype of the actual declared type of the property.
Converts the given object into one Mongo will be able to store natively but retains the type information in case
the given TypeInformation differs from the given object type.