Hello,
I’m trying to display how much is user being paid using Mongo query.
So far it claims that payment is undefenied, yet I see it if I type Meteor.users.find().fetch().
var payment = Meteor.users.findOne({"_id" : {$eq: Meteor.userId()}}).profile.payment;
Why i need _id.
I have Meteor.users() published fully for admins, and users can only see their own data.
So while for users I can use Meteor.userId().users.find().fetch()[0].profile.payment to find their own hourly payment, admins will see the very first user’s payment instead of their own.
So I need to perform a query filtering by user’s ID.