I am trying to get the key value from a subdocument, and I cannot figure out how to use the BasicDBObject.get () function, since the key is built into two levels. Here is the structure of the document
File {
name: file_1
report: {
name: report_1,
group: RnD
}
}
Basically the file has several reports, and I need to get the names of all the reports in this file. I can do BasicDBObject.get("name"), and I can get the value of "file_1", but how can I do something like this BasicDBObject.get("report.name")? I tried this, but it did not work.
Dhruv source
share