I am able to insert the following JSON into mongodb as such:
{
"Key1" : "Value1",
"Key2" : "Value2",
"Key3" : "Value3"
}
// C# (keys[] and values[] are already populated)
var document = new BsonDocument();
for(int i=0; i<keys.Length; i++)
{
document.Add(keys[i], values[i]);
}
I would like to insert a nested key/value pair as such:
{
"Key1" : {
"subKey1" : "subValue1"
}
"Key2" : "Value2",
"Key3" : "Value3"
}
Any help would be appriciated.