All,
I am using Appcelerator Cloud Services as my backend for an AngularJS/Ionic Framework/PhoneGap mobile app I am working on. I am trying to query the ACS Posts object by user_id and tags_array.
My code is at the following gist :
https://gist.github.com/bp4151/d6828f8d7af983316f99
I am formatting the query string as follows:
getByFriends: function(user_ids, tag) {
var query = "where={$and[{'user_id':$in['" + user_ids + "']},{'tags_array':$in['" + tag + "']}]}";
return $http.get('https://api.cloud.appcelerator.com/v1/posts/query.json?key=' + globals.ACSKey + '&query=' + query + '&_session_id = ' + globals.session_id);
},
I modified the code to the following, but I am still having no luck
getByFriends: function(user_ids, tag) {
//return $http.get('https://api.cloud.appcelerator.com/v1/posts/query.json?key=' + globals.ACSKey + '&query=' + query + '&_session_id = ' + globals.session_id);
return $http.get('https://api.cloud.appcelerator.com/v1/posts/query.json?key=' + globals.ACSKey + '&_session_id = ' + globals.session_id, {
params: {
query: "where={$and[{'user_id':$in['" + user_ids + "']},{'tags_array':$in['" + tag + "']}]}"
}
});
},
I expect only one post record to be returned with the id I am passing in (532f233f1316e90b760eca00) but I am getting all posts back no matter what I try. If anyone can point my in the right direction, I would really appreciate it.
Thanks,
Bruce