Reputation: 819
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
Upvotes: 0
Views: 101
Reputation: 4486
Without any fulltext utility, you can use regex on a Collection.find
like so:
Tasks.find({text: new RegExp(searchTerm,"ig")});
Upvotes: 1