0
我有如下我的文檔結構的搜索和:執行上主要收集場陣列的對象的同時
{
"codeId" : 8.7628945723895E13, // long numeric value stored in scientific notation by Mongodb
"problemName" : "Hardware Problem",
"problemErrorCode" : "97695686856",
"status" : "active",
"problemDescription" : "ghdsojgnhsdjgh sdojghsdjoghdghd i0dhgjodshgddsgsdsdfghsdfg",
"subProblems" : [
{
"codeId" : 8.76289457238896E14,
"problemName" : "Some problem",
"problemErrorCode" : "57790389503490249640",
"problemDescription" : "This is edited",
"status" : "active",
"_id" : ObjectId("589476eeae39b20b1c15535b")
},
...
]
}
我有應該由codeId
基本上充當搜索字段parentCodeID
搜索的搜索字段如圖所示下面
現在,parentIdCode
沿着我要搜索codeId
,problemCode
,problemName
和problemDescription
。
如何使用正則表達式查詢子查詢並同時用"$or"
子句等標記某些父字段來實現此目的?