dbcollectionuserswhere usernameadminaggregatelookup from menu localFieldmenu_id foreignFieldmenu_id as menuend查询有误修改查询语句
db.collection('users').aggregate([ { $match: { username: "admin" } }, { $lookup: { from: "menu", localField: "menu_id", foreignField: "menu_id", as: "menu" } } ])
原文地址: https://www.cveoy.top/t/topic/iJQw 著作权归作者所有。请勿转载和采集!