mongodb-lookup

MongoDB $lookup vs Mongoose populate

≯℡__Kan透↙ 提交于 2020-06-28 05:19:27
问题 I have seen this and other similar titled questions, none answer my question. I was going through the mongoose documentation where I read MongoDB has the join-like $lookup aggregation operator in versions >= 3.2. Mongoose has a more powerful alternative called populate(), which lets you reference documents in other collections. How does populate() in mongoose work that makes it more powerful than MongoDB's $lookup ? Isn't mongoose a tool that helps nodejs users work with mongodb. If so how