I have a class named Event, it has a column named end_time of type Date and a column named title of type String. I would like to fetch the events whose end_time column is either undefined or is greater than or equal to new Date(). This is not difficult as it can be done with the following code:
var query1 = new Parse.Query(Event);
var query2 = new Parse.Query(Event);
query1.doesNotExist("end_time");
query2.greaterThanOrEqualTo("end_time", new Date());
var query1And2 = Parse.Query.or(query1, query2);
query1And2 can correctly return the results I want. However, the problem is if I add one more constrain like: given a user specified title, return the events whose title is either undefined or equals user specified title. This constrain is not difficult to construct in its own, like:
var query3 = new Parse.Query(Event);
var query4 = new Parse.Query(Event);
query3.doesNotExist("title");
query4.equalTo("title", userTitle);
var query3And4 = Parse.Query.or(query3, query4);
but, how can I query Event with both query1And2 and query3And4?