Reputation: 20248
I am writing a cloud code function in parse. I am running a query and I am trying to figure out how to filter columns of the object I am querying for.
So, I am querying for user objects:
var userQuery = new Parse.Query(Parse.User);
userQuery.notEqualTo("username", username);
// so here how do I tell the query not return the values found in a column called "count"?
Thank you
Upvotes: 0
Views: 294
Reputation: 390
You need to use .select()
Example below:
Parse.Cloud.define("testFunction", function(request, response) {
var userQuery = new Parse.Query(Parse.User);
userQuery.contains("objectId","7Ijsxy1P8J");
//Here you say which columns you want, it will filter all other ones
userQuery.select("objectId", "firstName", "lastName");
userQuery.first({
success: function(result) {
response.success(result);
},
error: function(error) {
response.error("Failed with error ", error);
}
});
});
Over there I get a PFUser by its objectId but filtering only some fields. Hope it helps.
Upvotes: 1