I have this :
{
"_id" : ObjectId("4fb4fd04b748611ca8da0d48"),
"Name" : "Categories",
"categories" : [{
"_id" : ObjectId("4fb4fd04b748611ca8da0d46"),
"name" : "SubCategory",
"sub-categories" : [{
"_id" : ObjectId("4fb4fd04b748611ca8da0d47"),
"name" : "SubSubCategory",
"standards" : []
}]
}]
}
I would like to add a new SubCategory using the C# driver. Is there an optimal way to do this?
You can do this using
FindOneAndUpdateAsync
and positional operator