guys, I am trying to get all the PFUsers whose username is not included in an array (dontShowUsers
. I also want to limit the query with the variable name
, which gets all users whose username is equal a name the user searches. However when I do this:
findUsers.whereKey("username",containsString:name)
findUsers.whereKey("username",notContainedIn:dontShowUsers)
Every user shows. It peforms both these queries, and adds them together. I want to constrain the first whereKey
with the second whereKey
. What would be the best way to go about this?
this is one way
notice how i had to copy my user["rejected"] array from parse then i used + to create "ignoredUsers"
then i was able to use:
query.whereKey("username", notContainedIn: ignoredUsers)
I would say that you can solve this without using 2 constraints, just before you execute the query, check if name is in the the array, and if it's not, just execute the query.