I have a function in JS that returns a value from a Mongo query. What I would like it to return would be an array with a single string value of the Address field. This is what I've got:
mapAddress = function() {
return Demographic.find( {Fname: 'JOHN'}, {Lname: "DOE"}, {Address: 1, _id: 0} ).fetch()[0];
};
A query for John Doe is made and searches for those first and last names. Return only the Address field value in an array. I'm not sure if fetch() returns an array or not. How is this done?