0
注意:我通过在PC上执行代码添加了屏幕截图。我已经看到了这个多次,但我无法解释这至少对自己在MongoDB中,解决方法是什么?
在this MongoDB $unwind
for nodejs11:10分钟教程 - 喇叭说:
这个查询:
db.companies.aggregate([
{ $match: {"funding_rounds.investments.financial_org.permalink": "greylock" } },
{ $project: {
_id: 0,
name: 1,
amount: "$funding_rounds.raised_amount",
year: "$funding_rounds.funded_year"
} }
])
产生具有数量和年份数组的文档。
因为我们所访问的升高量和资助的一年,轮筹资阵列中的每个元素。 为了解决这个问题,我们可以对这个聚合管道我们的项目阶段之前退绕阶段,并说我们要
unwind
资金轮阵列参数如下:
db.companies.aggregate([
{ $match: {"funding_rounds.investments.financial_org.permalink": "greylock" } },
{ $unwind: "$funding_rounds" },
{ $project: {
_id: 0,
name: 1,
amount: "$funding_rounds.raised_amount",
year: "$funding_rounds.funded_year"
} }
])
unwind
具有输出到下一个阶段的多于其接收的文档作为输入的效果。
我的困惑:
- 什么问题扬声器在1点21分分钟指什么?
- 什么修复他指的是?