Hello,
How do I write C# code to retrieve only items where SID=100 for the input below?
Also, the C# output should preserve the input format.
This is for MongoDB 4.
[ { “_id”: “123456”, “Continent”: { “Country”: [ [ “US”, { “State”: [ [ 100, { “Product”: “Corn”, “SID”: 100 } ], [ 200, { “Product”: “Maze”, “SID”: 200 } ], [ 100, { “Product”: “Corn-HB”, “SID”: 100 } ] ], } ] ] } } ]
So the retrieved output should look like this:
[ { “_id”: “123456”, “Continent”: { “Country”: [ [ “US”, { “State”: [ [ 100, { “Product”: “Corn”, “SID”: 100 } ], [ 100, { “Product”: “Corn-HB”, “SID”: 100 } ] ], } ] ] } } ]