org.springframework.data.mongodb.core.convert

Interface MongoTypeMapper

  • All Superinterfaces:
    TypeMapper<org.bson.conversions.Bson>
    All Known Implementing Classes:
    DefaultMongoTypeMapper


    public interface MongoTypeMapper
    extends TypeMapper<org.bson.conversions.Bson>
    Mongo-specific TypeMapper exposing that Documents might contain a type key.
    Since:
    1.0
    Author:
    Oliver Gierke, Christoph Strobl
    • Method Detail

      • isTypeKey

        boolean isTypeKey(String key)
        Returns whether the given key is the type key.
        Returns:
      • writeTypeRestrictions

        void writeTypeRestrictions(org.bson.Document result,
                                   Set<Class<?>> restrictedTypes)
        Writes type restrictions to the given Document. This usually results in an $in-clause to be generated that restricts the type-key (e.g. _class) to be in the set of type aliases for the given restrictedTypes.
        Parameters:
        result - must not be null
        restrictedTypes - must not be null