我想使用meteorjs在一个反应表中使用两个集合。我有两个集合,我想在单个表中合并这些集合。我没有线索请帮忙!!!
答案 0 :(得分:1)
查看reywood:publish-composite
包裹。它允许您发布反应性连接。
答案 1 :(得分:0)
使用反应表时,您可以使用dynamic column,它允许您为列定义功能。然后,您可以使用此函数在另一个集合中查找数据。
示例:
{ fieldId: 'someOtherThing', // needs to be unique in your table
key: 'otherId', // this should be the _id of the other collection you want to "join"
label: 'Some Label',
fn: function(_id){
const otherObject = OtherCollection.findOne(_id);
if ( otherObject ) return otherObject.someKey;
}
},