我的一个项目集。
{
"id": {
"$oid": "5f4600ab7ec81f6c20f8608d"
},
"name": "2",
"category": "2",
"description": "2",
"deadline": "2020-08-10",
"createdBy": {
"$oid": "5f5089a2265ec85b896f848f"
},
"__v": 116,
"todos": [{
"time": {
"$date": "2020-09-10T06:15:36.168Z"
},
"doneAt": {
"$date": "2020-09-10T16:51:53.534Z"
},
"done": true,
"_id": {
"$oid": "5f59c4f53f0095593b2ace25"
},
"user": {
"$oid": "5f3fcbcae5efa018cc3c9b9d"
},
"text": "ooooooo"
}, {
"time": {
"$date": "2020-09-05T13:11:14.139Z"
},
"doneAt": null,
"done": false,
"_id": {
"$oid": "5f538f1eeef4d614830e843c"
},
"user": {
"$oid": "5f5089a2265ec85b896f848f"
},
"text": "11"
}],
"bugs": [{
"time": {
"$date": "2020-09-09T03:30:45.463Z"
},
"fixedAt": null,
"fixed": false,
"_id": {
"$oid": "5f584f152c5530129ff36ea2"
},
"user": {
"$oid": "5f3fcbcae5efa018cc3c9b9d"
},
"text": "new bug"
}, {
"time": {
"$date": "2020-09-06T09:35:12.848Z"
},
"fixedAt": null,
"fixed": false,
"_id": {
"$oid": "5f54e1220297a57896646e98"
},
"user": {
"$oid": "5f3fcbcae5efa018cc3c9b9d"
},
"text": "4"
}, {
"time": {
"$date": "2020-09-06T09:35:12.848Z"
},
"fixedAt": null,
"fixed": false,
"_id": {
"$oid": "5f54e0fc0297a57896646e97"
},
"user": {
"$oid": "5f3fcbcae5efa018cc3c9b9d"
},
"text": "5"
}],
"members": [{
"_id": {
"$oid": "5f57725977ead80a566855e4"
},
"user": {
"$oid": "5f3fcbcae5efa018cc3c9b9d"
}
}, {
"_id": {
"$oid": "5f576452fe05ec34a1bc487b"
},
"user": {
"$oid": "5f4c8654f4b8c6671d5926ac"
}
}, {
"_id": {
"$oid": "5f562a971e16aa39ca290391"
},
"user": {
"$oid": "5f5089a2265ec85b896f848f"
}
}]
}
有更多的项目集合。我只在这里放一个。我的目标是检索一个错误元素 例如
{
"time": {
"$date": "2020-09-09T03:30:45.463Z"
},
"fixedAt": null,
"fixed": false,
"_id": {
"$oid": "5f584f152c5530129ff36ea2"
},
"user": {
"$oid": "5f3fcbcae5efa018cc3c9b9d"
},
"text": "new bug"
}
每个项目集合和bug元素都有自己的ID。我只想使用猫鼬从项目对象中的bug数组中检索一个bug元素。
每个项目对象都具有相似的结构。