我在匹配mongodb集合中数组中的元素时遇到一些麻烦。
我有一个这样的条目:
{
"_id" : ObjectId("5d2c39063db7efa7ddd8d45b"),
"FatigueLevel" : NumberInt(3),
"TimeStamp" : NumberLong(1563179270344),
"mac_adress" : "4AE244D5883B",
"User" : "apimenta+survey@performetric.net",
"Performance" : {
"TimeStamp" : NumberLong(1563179265988),
},
"mDevices" : [
"HID\\VID_045E&PID_0745&MI_01&COL01\\7&35CF2DA6&0&0000",
"ACPI\\SYN1EF0\\4&A12D2AE&0"
],
"kDevices" : [
"ACPI\\HPQ8001\\4&A12D2AE&0",
"USB\\VID_045E&PID_0745&MI_00\\6&19BDBCFB&0&0000"
],
"mSensibility" : 12.0,
"screenDpi" : NumberInt(96),
"screenWidth" : NumberInt(1366),
"screenHeight" : NumberInt(768)
}
我想使用Java和聚合框架查看某个mdevice是否在mdevices数组中,该怎么做?