[英]How to get a specific result from the mongodb collection in Meteor
I want to get some results that a certain field has the same value as a selectedItem value in my html. 我想得到一些结果,即某个字段与html中的selectedItem值具有相同的值。 I'm using Meteor : 我正在使用Meteor:
Template.Bd.helpers({
'd': function () {
return List.find({
region: event.target.RegionValue.options[RegionValue.selectedIndex].text.value
}).fetch();
}
});
I think I just have to put the function in the template events not in the helpers 我想我只需要将函数放在模板事件中,而不是在助手中
'change Region': function(event) {
return List.find({r:event.target.Region.options[Region.selectedIndex].text.value}).fetch();
console.log("changed");
}
I avoided the bug but the code is still not working. 我避免了该错误,但是代码仍然无法正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.