Hi, I'm pretty new to Meteor, so sorry if this is a stupid question. Hopefully someone can point me in the right direction.
In my chat app, I have a page that uses an easysearch input to search the available users by username. To do this I've created an index of the profile in the Meteor.users collection. I want to know how I can remove the current user from the easy search results. So far I've done it with a template helper function - , but this isn't ideal because it just hides the result and it's pretty hacky. I would like to remove it to maintain correct functionality of .IfNoResults.
What is the best way to do this? A custom selector in the index? An outer function which removes the current user from the index?
Here's my index:
UsersIndex` = new EasySearch.Index({
collection: Meteor.users,
fields: ['profile.username'],
engine: new EasySearch.Minimongo()
});
Hi, I'm pretty new to Meteor, so sorry if this is a stupid question. Hopefully someone can point me in the right direction.
In my chat app, I have a page that uses an easysearch input to search the available users by username. To do this I've created an index of the profile in the Meteor.users collection. I want to know how I can remove the current user from the easy search results. So far I've done it with a template helper function - , but this isn't ideal because it just hides the result and it's pretty hacky. I would like to remove it to maintain correct functionality of .IfNoResults.
What is the best way to do this? A custom selector in the index? An outer function which removes the current user from the index?
Here's my index:
Here's my helper:
and my template: