MongoDB NodeJS Native Driver(mongodb) vs Mongo Shell Performance
问题 I have 10000 records in MongoDB in table1. Data is as below: "_id" : ObjectId("5d5e500cb89312272cfe51fc"), "cities" : [ { "cityid" : "5d5d2205cdd42d1cf0a92b33", "value" : "XYZ" }, { "cityid" : "5d5d2214cdd42d1cf0a92b34", "value" : "Rowcliffe" }, ], Query is as below: { $unwind: "$cities" }, { "$addFields": { "cities.cityid": { "$toObjectId": "$cities.cityid" } } }, { $lookup: { from: "cities", localField: "cities.cityid", foreignField: "_id", as: "docs" } }, So, here i lookup cityid in