LiteDbBsonConverter
Namespace: Meshmakers.Octo.Sdk.Common.EtlDataPipeline.Nodes.Buffering
Class to convert between System.Text.Json values and LiteDB values for storage in the edge buffer.
public static class LiteDbBsonConverter
Inheritance Object → LiteDbBsonConverter
Methods
ToBson(JsonNode)
Converts a to a . Used for round-trip storage of arbitrary JSON shapes in LiteDB. nodes become .
public static BsonValue ToBson(JsonNode node)
Parameters
node JsonNode
Returns
BsonValue
ToDictionary(JsonNode)
Converts a object root into a flat Dictionary<TKey, TValue> of property name to BSON value (one level deep). Non-object inputs (including ) yield an empty dictionary.
public static Dictionary<string, BsonValue> ToDictionary(JsonNode node)
Parameters
node JsonNode
Returns
FromBson(BsonValue)
Converts a back into a . Returns for null/missing inputs.
public static JsonNode FromBson(BsonValue bsonValue)
Parameters
bsonValue BsonValue
Returns
JsonNode
FromDictionary(Dictionary<String, BsonValue>)
Converts a flat dictionary of BSON values back into a .
public static JsonObject FromDictionary(Dictionary<string, BsonValue> dict)
Parameters
dict Dictionary<String, BsonValue>
Returns
JsonObject
MergeDictionaries(Dictionary`2[])
Merges multiple dictionaries into one. Values for duplicate keys are merged using : arrays concatenate, documents merge recursively, and scalar collisions are wrapped into a 2-element array.
public static Dictionary<string, BsonValue> MergeDictionaries(Dictionary`2[] dictionaries)
Parameters
dictionaries Dictionary`2[]