Вот документ.
Как использовать mongoQuery для branchId , значение которого должно быть e63a5343-871c-47ee-8fe6-31d9b7f9fa1b1 и для данных, возвращаемых только с этим BranchId.
Я использую
db.collection.find ({
'checkinDetails.presenceTable': {$ elemMatch:
{ 'PriorityDevice.branchId': "e63a5343-871c-47ee-8fe6-31d9b7f9fa1b1"}}
{
"checkinDetails": {
"userCount": NumberInt("9"),
"presenceTable": [
{
"entity": {
"entityCategory": "Users",
"entityType": "User",
"entityName": "Raghvendra",
"id": "25d156df-2c7e-4506-a5b0-969bf5d0745b"
},
"fromState": "current",
"priorityDevice": {
"aclFlag": false,
"zoneGranularity": NumberInt("300000"),
"csId": "0577936e-f81c-4386-bae7-0255a28ee374",
"branchId": "e63a5343-871c-47ee-8fe6-31d9b7f9fa1b1",
"txPower": NumberInt("-54"),
"filterRSSI": -63.15999016102085,
"rssi": NumberInt("-55"),
"time": "2019-01-17T14:38:11.804Z",
"zoneId": "e813b2f3-88f8-4111-b2bb-50bb7dfb0ba7",
"deviceId": "26341b09-9b16-4de4-a9ce-74dd3a858be8"
}
},
{
"entity": {
"entityCategory": "Users",
"entityType": "User",
"entityName": "Rahul Saini",
"id": "8f067f5b-6a8f-4237-a760-109303def580"
},
"fromState": "current",
"priorityDevice": {
"aclFlag": false,
"zoneGranularity": NumberInt("300000"),
"csId": "0577936e-f81c-4386-bae7-0255a28ee374",
"branchId": "e63a5343-871c-47ee-8fe6-31d9b7f9fa1b",
"txPower": NumberInt("-54"),
"filterRSSI": -66.44148222664761,
"rssi": NumberInt("-61"),
"time": "2019-01-17T14:38:11.803Z",
"zoneId": "e813b2f3-88f8-4111-b2bb-50bb7dfb0ba7",
"deviceId": "26341b09-9b16-4de4-a9ce-74dd3a858be8"
}
},
{
"entity": {
"entityCategory": "Users",
"entityType": "User",
"entityName": "Shubham Saurabh",
"id": "4f0fe333-3f9f-457f-8046-5476573323fb"
},
"fromState": "current",
"priorityDevice": {
"aclFlag": false,
"zoneGranularity": NumberInt("300000"),
"csId": "0577936e-f81c-4386-bae7-0255a28ee374",
"branchId": "e63a5343-871c-47ee-8fe6-31d9b7f9fa1b1",
"txPower": NumberInt("-62"),
"filterRSSI": -61.489655691672645,
"rssi": NumberInt("-57"),
"time": "2019-01-17T14:38:11.799Z",
"zoneId": "e813b2f3-88f8-4111-b2bb-50bb7dfb0ba7",
"deviceId": "26341b09-9b16-4de4-a9ce-74dd3a858be8"
}
}
]
"type": "presenceTable"
}