[英]Object access via Angular
I want to acccess the fields category and specCategory. 我要访问字段类别和specCategory。 I applied *ngFor="let x of data" {{x._id.category}}
but it is not working. 我应用了*ngFor="let x of data" {{x._id.category}}
但是它不起作用。 Whats wrong with it? 它出什么问题了?
I am using aggregate functionality to group the categories. 我正在使用聚合功能对类别进行分组。
$group: {
_id: {
category: "$category",
specCategory: "$specCategory"
},
min: {$min: '$price'},
max: {$max: 500},
total:{$sum:1}
}
Result: 结果:
[ { _id: { category: 'Wasser & Wind', specCategory: 'Surfen' }, min: 49, max: 500, total: 1 }, { _id: { category: 'Reisen', specCategory: 'Hotel' }, min: 49, max: 500, total: 1 } ]
I will need to access the category, specCategory and total value 我将需要访问类别,specCategory和总价值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.