I am new to MongoDB queries and looking for some guidance on how to retrieve documents that fit the search criteria. In particular, I need to find all the id(s) of the documents where the code is JPID i.e, "code": "JPID". We can assume the name of the collection is systems.
Since this is a nested object I thought of using the $unwid - but I am still stuck on how to do it. The example is very trivial. Any help and guidance is appreciated.
{
"resourceType": "NamingSystem",
"id": "example-id",
"name": "Austalian Healthcare Identifier - Individual",
"status": "active",
"kind": "identifier",
"date": "2015-08-31",
"publisher": "HL7 Australia on behalf of NEHTA",
"responsible": "HI Service Operator / NEHTA",
"type": {
"coding": [
{
"system": "http://hl7.org/fhir/v2/0203",
"code": "JPID";
"display": "National unique individual identifier"
}
],
"text": "IHI"
},
"description": "Australian HI Identifier as established by relevant regulations etc",
"uniqueId": [
{
"type": "oid",
"value": "1.2.36.1.2001.1003.0",
"comment": "This value is used in Australian CDA documents"
},
{
"type": "uri",
"value": "http://ns.electronichealth.net.au/id/hi/ihi/1.0",
"preferred": true,
"period": {
"start": "2015-08-21"
}
}
]
}