0

While I build the query in cloud code, I have or conditions on fields as well as other conditions on other fields. For an instance, I'd like to get the records which has specified zip code or empty value. Query would be as following if I use Parse.Query.or();

    var Offer = Parse.Object.extend("Offer");
    var query1 = new Parse.Query(Offer);
    query1.doesNotExist("zipCode");

    var query2 = new Parse.Query(Offer);
    query2.exists("zipCode");
    query2.equalTo("zipCode", zipCode);

    query = Parse.Query.or(query1, query2);

I have no problem if I have a such condition but it's tough to have similar conditions on multiple fields.

Pei
  • 11,452
  • 5
  • 41
  • 45

0 Answers0