meteor自动完成服务器端
我正在编写一个meteor应用程序,并试图在搜索框中添加一个自动完成功能。数据非常大,并且在服务器上,所以我不能将所有数据都放在客户机上。它基本上是一个用户数据库。如果我没有错的话,这个软件包应该能让这一切成为可能,但我似乎无法让它发挥作用 以下是我在服务器上拥有的内容:meteor自动完成服务器端,meteor,autocomplete,server-side,Meteor,Autocomplete,Server Side,我正在编写一个meteor应用程序,并试图在搜索框中添加一个自动完成功能。数据非常大,并且在服务器上,所以我不能将所有数据都放在客户机上。它基本上是一个用户数据库。如果我没有错的话,这个软件包应该能让这一切成为可能,但我似乎无法让它发挥作用 以下是我在服务器上拥有的内容: Meteor.publish('autocompleteViewers', function(selector, options) { Autocomplete.publishCursor(viewers.find(sel
Meteor.publish('autocompleteViewers', function(selector, options) {
Autocomplete.publishCursor(viewers.find(selector, options), this);
this.ready();
});
以下是我在客户端上用于搜索框的设置:
getSettings: function() {
return {
position: 'bottom',
limit: 5,
rules: [{
subscription: 'autocompleteViewers',
field: '_id',
matchAll: false,
options: '',
template: Template.vLegend
}],
};
}
Error: Collection name must be specified as string for server-side search at validateRule
但我一直在客户端上发现这个错误:
getSettings: function() {
return {
position: 'bottom',
limit: 5,
rules: [{
subscription: 'autocompleteViewers',
field: '_id',
matchAll: false,
options: '',
template: Template.vLegend
}],
};
}
Error: Collection name must be specified as string for server-side search at validateRule
我真的不明白这个问题。当我查看包代码时,它看起来就像是在测试订阅字段是否是字符串而不是变量,实际上是。知道问题出在哪里吗?否则,是否有一个我可以从某处得到的最低限度的工作示例?我在文件里找不到
Error: Collection name must be specified as string for server-side search at validateRule
出现此错误是因为未在引号中指定集合
名称
getSettings: function() {
return {
position: 'bottom',
limit: 5,
rules: [{
subscription: 'autocompleteViewers',
field: '_id',
matchAll: false,
collection: 'viewers', // <- specify your collection, in your case it is a "viewers" collection.
options: '',
template: Template.vLegend
}],
};
getSettings:function(){
返回{
位置:'底部',
限额:5,
规则:[{
订阅:“自动完成查看器”,
字段:“\u id”,
matchAll:错,
收集:"观众",//