0
我有这个测验文件:如何发布隐藏了某些字段的数组中的某些元素?
{
_id: 001,
quiz: "cartoon familes",
questions:[
{
_id: 100,
question: "who is the eldest ?",
order: 1,
answers: [
{ _id: 101, answer: "Bart Simpson", points: 100 },
{ _id: 102, answer: "Lisa Simpson", points: 0 },
{ _id: 103, answer: "Maggie Simpson", points: 0 }
]
},
{
_id: 200,
question: "who is the eldest ?",
order: 2,
answers: [
{ _id: 201, answer: "Chris Griffin", points: 0 },
{ _id: 202, answer: "Meg Griffin", points: 100 },
{ _id: 203, answer: "Stewie Griffin", points: 0 }
]
}
]
}
我想要得到的只是有一个字段order: 1
(所有其他问题将被隐藏)的问题,我也希望points
场被隐藏。
我该怎么做?
谢谢费利克斯!我需要使用'meteorhacks:聚合'的权利? –
@SegevLahav是的,这应该适用于'meteorhacks:aggregate' – felix