$lookup After multiple document association queries, use $count, which takes 20-30s

Description: v4.2.x. Data volume: 3W
example:
db.getCollection("maxchain-Wnqhu06pAW-WxyfAwgEn3Vi-DEV_SYS_LOGISTICSDEVICE").aggregate( [{"$sort": {"txDate": -1}}, {"$lookup": {"localField": "record.lbCode", "as": "tb", "foreignField": "record.lbCode", "from": "maxchain-Wnqhu06pAW-WxyfAwgEn3Vi-DEV_SYS_LOGISTICSBATCH"}}, {"$unwind": {"path": "$tb", "preserveNullAndEmptyArrays": true}}, {"$lookup": {"localField": "record.devNum", "as": "ts", "foreignField": "record.devNum", "from": "maxchain-Wnqhu06pAW-WxyfAwgEn3Vi-DEV_SYS_STOCK"}}, {"$unwind": {"path": "$ts", "preserveNullAndEmptyArrays": true}}, {"$project": {"record": 1, "tb.record": 1, "ts.record": 1}}, {"$match": {"record._isDel": false, "record.devStatus": {"$in": ["2", "4"]},"tb.record.rgCode": "04971", "tb.record._isDel": false}}, {"$count": "total"}]);