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" : "test@test.com",
"verified" : false
}
]
"votes" : [
{
"ZyYZ4LDTaeWNMN9eE" : "yes"
}
]
}
let votes = Meteor.userId().votes
returns undefined
.
How can I return the [votes] array ?