I have a "Event" class in Parse DB which has two pointers called "Feature" and "Network". See below for reference:
I want to retrieve objects from Event class which have the selected array of features and in the selected networks. I tried to do the query as below:
func getEventsByFilter(networks: [Network]?, features: [Feature]?,completion: (events: [Event]?, error: NSError?) -> ()) {
let query = PFQuery(className:"Event")
query.whereKey("feature", containedIn: features!)
query.whereKey("network", containedIn: networks!)
However, I get the following error and the query returns all the events in the Events class: [Error]: Caught "NSInvalidArgumentException" with reason "Invalid type in JSON write (MyApp.Network)":
Any suggestions on how to rewrite the query so that I can get events that are in the selected networks and having the features that are selected?
Any help appreciated! Thanks!
