T - the type of the object to convert to a Documentpublic interface MongoWriter<T> extends EntityWriter<T,org.bson.conversions.Bson>
| Modifier and Type | Method and Description |
|---|---|
default Object |
convertToMongoType(Object obj)
Converts the given object into one Mongo will be able to store natively.
|
Object |
convertToMongoType(Object obj,
TypeInformation<?> typeInformation)
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. |
com.mongodb.DBRef |
toDBRef(Object object,
MongoPersistentProperty referingProperty)
Creates a
DBRef to refer to the given object. |
write@Nullable default Object convertToMongoType(@Nullable Object obj)
obj - can be null.@Nullable Object convertToMongoType(@Nullable Object obj, @Nullable TypeInformation<?> typeInformation)
TypeInformation differs from the given object type.obj - can be null.typeInformation - can be null.com.mongodb.DBRef toDBRef(Object object, @Nullable MongoPersistentProperty referingProperty)
DBRef to refer to the given object.object - the object to create a DBRef to link to. The object's type has to carry an id attribute.referingProperty - the client-side property referring to the object which might carry additional metadata for
the DBRef object to create. Can be null.Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.