我正在使用meteor.js。我有三个收藏板,阵容
Boards :
{
"_id": ObjectId("su873u498i0900909sd"),
"locked": NumberInt(0),
"board_name": "Legends",
"description": "legends of the world",
"apartments": [{id:ObjectId("su873u498i0900909sd"),"val":'sdfs','lineup':[ObjectId("su873u498i0900f09sd"),ObjectId("su873u498i0900f09sd")]},{id:ObjectId("s78898973u498i0900909sd"),"val":'sdfs','lineup':[ObjectId("su873u498i0900f09sd"),ObjectId("su873u498i0900f09sd")]}],
"cost": NumberInt(1),
"image": "1389249002691_indexhj.jpeg",
"creator": ObjectId("52ce317994acdcee0fadc90c")
}
lineup:
{
"_id": ObjectId("su873u498i0900f09sd"),
"uid": ObjectId("su873u498i0900909sd"),
sname:"hjjj"
}
我如何使用发布合成来迭代板中的公寓字段,然后使用公寓中的阵容从阵容集合中查找数据
答案 0 :(得分:2)
您要做的是加入数据,您可以在Meteor.publish
的服务器上通过基于{lineup
_id
来查询apartments
1}},然后使用here所述的transform
函数。