What is the reason I am unable to use a variable to access something inside my document? It seems that hard coding the field works, but when using a variable, it does not yield the expected result.
building = "AS"
room = "243"
item = "whiteBoard.votes[0]"
RI.findOne({$and: [{"building": building }, {"room": room}]}, (err, x) => {
console.log(x.whiteBoard.votes[0]) //This line prints successfully
console.log(x[item]) //However, this line returns undefined