简体   繁体   中英

How to add search in meteor todo app example

I try to add a search field in the todo app example of meteorjs, but I don't know how to do it.

I can get the value of the search field with a event but after that I don't know how to filter the "Tasks" collection.

Anyone know how to handle this ?

Thanks

如果没有任何全文本实用程序,则可以在Collection.find上使用正则表达式,如下所示:

Tasks.find({text: new RegExp(searchTerm,"ig")});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM