MongoDB Get Specific Field From Collection in Meteor

Hello, today I wanted to get one field from my collection in meteor.

For this, I created template helper and added two parameters like this.

Template.registerHelper( 'getInfo', (id, field) => {
    return Users.findOne({ _id: id}).[field] 
});

Now I am getting specific information of user by specific id.

Usage in template:
[hmtl]{{getInfo userID “user_name”}}[/html]
or you can use like this:
[hmtl][/html]

Enjoy 🙂