我想使用meteorjs在一个反应表中使用两个集合。我有两个集合,我想将这些集合合并到一个表中。我没有线索,请帮帮我!
发布于 2016-04-28 20:35:58
请看一下reywood:publish-composite包。它允许您发布响应式连接。
发布于 2016-04-29 00:43:46
当使用反应表时,您可以使用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;
}
},https://stackoverflow.com/questions/36913778
复制相似问题