org.springframework.data.mongodb.util

Class BsonUtils



  • public class BsonUtils
    extends Object
    Since:
    2.0
    Author:
    Christoph Strobl, Mark Paluch
    • Constructor Detail

      • BsonUtils

        public BsonUtils()
    • Method Detail

      • get

        @Nullable
        public static <T> T get(org.bson.conversions.Bson bson,
                                          String key)
      • asMap

        public static Map<String,Object> asMap(org.bson.conversions.Bson bson)
      • addToMap

        public static void addToMap(org.bson.conversions.Bson bson,
                                    String key,
                                    @Nullable
                                    Object value)
      • toJavaType

        public static Object toJavaType(org.bson.BsonValue value)
        Extract the corresponding plain value from BsonValue. Eg. plain String from BsonString.
        Parameters:
        value - must not be null.
        Returns:
        Since:
        2.1