且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在同一条语句中使用填充和聚合?

更新时间:2021-08-29 22:28:37

使用最新版本的猫鼬(mongoose> = 3.6),您可以,但它需要第二次查询,并且使用不同的填充方式.汇总后,请执行以下操作:

With the latest version of mongoose (mongoose >= 3.6), you can but it requires a second query, and using populate differently. After your aggregation, do this:

Patients.populate(result, {path: "patient"}, callback);

猫鼬API 查看全文