良い日、EasySearchパッケージを使用した流星の簡単な検索機能
簡単検索パッケージを使用して簡単な検索機能を作成しようとしています。一言で言えば
私は、次のようなクライアント上のスキーマとインデックスを定義following-
行っている:
const Patients = new Mongo.Collection('patients');
const PatientsIndex = new EasySearch.Index({
collection: Patients,
fields: ['name'],
engine: new EasySearch.MongoDB()
});
データベース:
meteor:PRIMARY> db.patients.find()
{ "_id" : ObjectId("57d6a9f71bad26ba07748f9d"), "name" : "Paul" }
Template.searchBox.helpers({
patientsIndex:() => PatientsIndex
});
そして最後に、私はテンプレートを出力すべき結果作成しました::
<template name="searchBox">
{{> EasySearch.Input index=patientsIndex }}
<ul>
{{#EasySearch.Each index=patientsIndex }}
<li>Name of the patient: {{name}}</li>
{{/EasySearch.Each}}
</ul>
</template>
何らかの理由でこれがうまくいかず、テンプレートに何も表示されません。これはとても新しいものであり、本当に助けに感謝します。
ありがとうございます。
ご協力いただきありがとうございます。私は今理解しており、完璧な意味合いがあり、うまく機能しています。興味のある問題として、結果をグリッドに戻すにはどうすればよいですか? – Jacques