Tag:

如何在parsing中使用includeKey查询“Or”?

所以,我在Parse and Place模型中有Event模型。 每个模型都有地方。 另外我有用户,每个事件都有主人。 所以,我需要在我的位置周围10英里的地方获得我的活动或事件,以获得我使用的活动 let query = Event.query() query.whereKey("author", containedIn: [PFUser.currentUser()!]) query.includeKey("place") 它的工作,但现在我需要添加OR操作,并find我使用的10英里的事件 let placeQuery = PFQuery(className: "Place") placeQuery.whereKey("location", nearGeoPoint: PFGeoPoint(latitude: location!.coordinate.latitude, longitude: location!.coordinate.longitude), withinMiles: 20.0) 而我怎么需要主查询使用这两个? 我努力了 var resultQuery:PFQuery = PFQuery.orQueryWithSubqueries([query, placeQuery]) 但它给了我一个错误,orQueryWithSubqueries需要使用相同的类