I'am trying to query a document of the specified objectID from a collection and get the nested array from that document.
Here is the sample of a document from my collection.
{
"_id" : ObjectId("54f46d20793f2c2dd4eaaa60"),
"academicQualifications" : [
{
"degreeCompleted" : "Masters' in other fields",
"degree" : "Master in Engineering Education",
"when" : "2010-present",
"Where" : "WIT, Iloilo CIty",
"Remarks" : "12 units earned, Ongoing"
},
{
"degreeCompleted" : "Masters' in other fields",
"degree" : "MS Computer Engineering",
"when" : "1995-200",
"Where" : "WIT",
"Remarks" : ""
}
]
}
Here is my entity
class facultyData
{
public ObjectId _id { get; set; }
public List<acadQualifications> academicQualifications { get; set; }
}
class acadQualifications
{
public ObjectId _id { get; set; }
public string degreeCompleted { get; set; }
public string degree { get; set; }
public string when { get; set; }
public string where { get; set; }
public string remarks { get; set; }
}
So what I wanted to accomplish is, to get the "degree", "when", "where" and remarks values from each item of the array and append them to a string that I will later be used for a table.
Here's what it should look like on a string.
For the degree, "Master in Engineering Education / MS Computer Engineering" the same with when, where, remarks.
academicQualifications[x].degreeCompletedIt might give you what you want.