ParseSwift - is it possible to do an "or" query?

Is it possible to do queries with ParseSwift and do an “or” query?

(name = x) or (altNamesArray contains x)

So my situation is I have a Location Object which has a name field and an altNames (array) field. If I wanted to search for a location object, I would like it search for a matching name in either column.

For example, if the Location object is “United States”. an altName would be “USA”

I’m trying to figure out the query to search for “United States” in both “name” and “altNames” column.

My other option is maybe just making my primary column “name” be an array of names instead of it containing a string. So when I query, I only need to find a match in the new array column.

Any help or guidance would be appreciated. :slight_smile:

*and is there ParseSwift documentation aside from the Playground I’m missing?

Yes, check the documentation for or

The complete documentation for for the SDK is here:

http://parseplatform.org/Parse-Swift/api/index.html

1 Like