public class BsonUtils extends Object
Constructor and Description |
---|
BsonUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addToMap(org.bson.conversions.Bson bson,
String key,
Object value) |
static Map<String,Object> |
asMap(org.bson.conversions.Bson bson) |
static <T> T |
get(org.bson.conversions.Bson bson,
String key) |
static org.bson.Document |
merge(org.bson.Document... documents)
Merge the given
documents into on in the given order. |
static org.bson.Document |
toDocumentOrElse(String source,
Function<String,org.bson.Document> orElse) |
static Object |
toJavaType(org.bson.BsonValue value)
Extract the corresponding plain value from
BsonValue . |
static String |
toJson(org.bson.Document source)
Serialize the given
Document as Json applying default codecs if necessary. |
public static void addToMap(org.bson.conversions.Bson bson, String key, @Nullable Object value)
public static Object toJavaType(org.bson.BsonValue value)
value
- must not be null.public static org.bson.Document merge(org.bson.Document... documents)
documents
into on in the given order. Keys contained within multiple documents are
overwritten by their follow ups.documents
- must not be null. Can be empty.public static org.bson.Document toDocumentOrElse(String source, Function<String,org.bson.Document> orElse)
source
- orElse
- Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.