Console.log a custom User field


I first need to check if an array [votes] exists before inserting more data.

Here is the json structure :

    "_id" : "pziqjwGCd2QnNWJjX",
    "createdAt" : ISODate("2017-12-21T22:06:41.930Z"),
    "emails" : [ 
            "address" : "",
            "verified" : false
    "votes" : [ 
            "ZyYZ4LDTaeWNMN9eE" : "yes"


let votes = Meteor.userId().votes returns undefined.

How can I return the [votes] array ?


Meteor.userId() return the user id if logged. If u want the user document, u need to use Meteor.user().
Check also the docs if u want to know more.


ALright thank you, doing so it returns the object but not that particular field. Is there a way to target the field like Meteor.user().votes ?


Check the Meteor Guide on this topic.