【发布时间】:2016-12-10 04:56:03
【问题描述】:
我有两个单独的集合,Patients 和 Invoices:
Patients Collection
{
first_name: ...
surname: ...
...
}
Invoices Collection:
{
invoice_no: ...
patient_id: ...
...
}
我想显示一个显示所有发票的表格。在这些列中,我想向患者展示与发票相关的内容(我将patient_id 作为Invoices 集合中的字段之一)。
所以我有这个助手:
Template.showInvoices.helpers({
invoices: function () {
return Invoices.find(); // i know this isn't ideal.
}
});
这是模板:
<template name="showInvoices">
{{#each invoices}}
<tr>
<td>{{invoice_no}}</td>
<td> [PATIENT NAME] </td>
</tr>
{{/each}}
</template>
如何从发票数据上下文中获取患者姓名?来自 MySQL 和关系数据库,我不禁想知道这是否适合我的特殊情况,因为我不完全确定如何执行此查询。我应该改变我的设计吗?
【问题讨论】:
标签: html mongodb meteor meteor-blaze