I found that Parse Query is pretty unreliable as soon as you start adding to multiple filters, and this might be a bug, but there seems to be no big reason for this. What I did when I have several filters is NSPredicate.
NSPredicate *minPredicate = [NSPredicate predicateWithFormat:@"date >= %@", minimumDate]; NSPredicate *maxPredicate = [NSPredicate predicateWithFormat:@"date < %@", maximumDate]; NSPredicate *predicate = [NSCompoundPredicate andPredicateWithSubpredicates:@[minPredicate,maxPredicate]]; PFQuery *foodList = [PFQuery queryWithClassName:@"Food" predicate:predicate]; [foodList orderByAscending:@"expiration_date"]; [foodList findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { }];
Another possibility is that your query filters the date, and then you order "expiration_date", and I'm not sure if there is a gap between the two. Make sure your item list is what you want.
source share