i have the following JSON in MongoDB:
"ScurvePlanName": "PipeTrack",
"ScurvePlanData": [{
"Levels": "Mechanical",
"Scope": null,
"StartDate": null,
"EndDate": null,
"Weightage": {
"$numberDouble": "20"
},
"ParentLevels": "",
"ActivityId": null,
"IsInternal": false
}, {
"Levels": "Welding",
"Scope": {
"$numberDouble": "2000"
},
"StartDate": "898989667687687768768",
"EndDate": "898989667687687768768",
"Weightage": {
"$numberDouble": "5"
},
"ParentLevels": "Mechanical",
"ActivityId": {
"$numberDouble": "5"
},
"IsInternal": true
}]
}
I only need objects inside the array which is the value of key “ScurvePlanData”.
This is my current code:
var fdbFiller= Builders<BsonDocument>.Filter.Eq("ScurvePlanName", SCurveName);
var projection = Builders<BsonDocument>.Projection.Include("ScurvePlanData");
var cursor = collection.Find<BsonDocument>
(fdbFiller).Project(projection).ToCursor();
yours sincerely