I am building an app using Meteor and need to access the stored email address of a logged-in user.
I am currently using:
var userObj = Meteor.user();
console.log(userObj);
to access the user. However, I am only able to access the id. The email address is stored in a nested object that looks like this:
[Object {address="address@gmail.com", verified=false}]
I have tried various ways to traverse the JSON object but can’t figure out how to access the value I need.
Meteor.user().emails[0].addressworks for me.Here’s what the doc says:
Example user document: