{
"comType": 1,
"createTime": "2022-01-05 19:44:32",
"url": "https://..",
"userList": [
{
"userId": "1ef3c51361d290c9017b0a86025c7b1d",
"completeId": "",
"completeTime": ""
},
.....
],
"users": [
{
"_id": "1ef3c51361d290c9017b0a86025c7b1d",
"name": "aaa",
"org": "AAA",
"updateTime": "2022-01-03 10:55:25",
"avatarUrl": "https://thirdwxb5lw/132",
"createTime": "2022-01-03 00:27:46",
"userType": 1
},
...
]
}
这是我aggregate lookup查询出来的结果,如何把userList数组和users数组通过userId和_id匹配并合并为一个数组,如:
"completeId": "",
"completeTime": ""
"_id": "1ef3c51361d290c9017b0a86025c7b1d",
"name": "aaa",
"org": "AAA",
"updateTime": "2022-01-03 10:55:25",
"avatarUrl": "https://thirdwxb5lw/132",
"createTime": "2022-01-03 00:27:46",
"userType": 1
求查询语句
0 Commentaires