I need to use "db.RunCommand" to get an item from an array embedded into a collection. I am just starting MongoDB and I am having difficulty looking into the MongoDB documentation since i can't find much examples using directly the "RunCommand" method.
So if i have this example
[
{
"Brand": {
"Name": "Brand name 1",
"Products": [
{
"Product": "Product 1",
"Price": 20.33
},
// i need to get only the following object
{
"Product": "Product 2",
"Price": 10.33
},
{
"Product": "Product 2",
"Price": 15.33
}
]
}
}
]
So how can i construct the query into the "RunCommand(--query here--)" to get only "Product 2" ? So the result would be
{
"Product": "Product 2",
"Price": 10.33
}
If is needed, i am using C# .net Core with MongoDB Driver