Open Simranjitk opened 7 years ago
I have a collection
marks { testers: { { "class": "math", "mark": 81 }, { "class": "english", "mark": 90 } } }
So, my server method is
SearchSource.defineSource('packages', function(searchText, options) { console.dir(searchText); if(searchText) { var regExp = buildRegExp(searchText); var options = {limit: 20}; var selector = {"testers.class": regExp} return marks.find(selector, options).fetch(); } } else { return marks.find({}, options).fetch(); } });
This returns every single 'class' object if one of them matches the search query. If I search "english", I want it to just return the word 'english'. How can I do this?
I have a collection
So, my server method is
This returns every single 'class' object if one of them matches the search query. If I search "english", I want it to just return the word 'english'. How can I do this?