How to get user_id pointer value
I have the following code below, however I am not getting any results based on the following query. I have a user_id which is part of the info_collection and is a pointer to the _id column in Users table. I want to pass in the user id in the params.criteria and then get a "weight" for each user id passed in, but the query returns nothing. Not sure where the problem is....
pre
var DB_id = "my_db_id";
var masterKey = "my_master_key";
var timezone = 'America/Antigua';
var collectionName = "info_collection";
try {
result = {};
var params = {};
params.criteria = {
"user_id": "539f537ae4b0d8c87ced0dc7"
};
//Define other parameters
result.query = Collection.query(DB_id, collectionName, params); //Make the query and save it to the result object
//response.success(result, "application/json");
var i, len, weight;
for (i = 0, len = result.query.length; i < len; i++) {
weight = result.query['weight'];
console.log(weight);
}
} catch (e) {
response.success("message: " + e.message + "ncode: " + e.code);
}
/pre