Im developing an app with User and Request as classes on Parse. My Users have currentLocation (PFGeoPoint) as an attribute and Requests have a pointer to refer the User that owns the request (requestor:PFUser). So Im trying to find requests from users near to the current user logged in.
I need to do something like:
let currentUserGeoPoint = PFUser.currentUser()!["currentLocation"] as! PFGeoPoint
var query = PFQuery(className:"Request")
query.whereKey("requestor.currentLocation", nearGeoPoint: currentUserGeoPoint)
query.findObjectsInBackgroundWithBlock {
(objects, error) -> Void in
if (error == nil) {
self.userRequests = objects!
self.tableView.reloadData()
}else {
println(error?.userInfo)
}
}
But unfortunatelly this is not possible:
[Error]: Dot notation can only be used on objects (Code: 102, Version: 1.8.1)
Optional([code: 102, error: Dot notation can only be used on objects, temporary: 0, NSLocalizedDescription: Dot notation can only be used on objects])
Any ideas?
This is how my Request Class looks like on Parse:
This is the User Class:
For example, a Pointer to a Post could be represented as: When the query is issued with an include parameter for the key holding this pointer, the pointer will be expanded to: You can also do multi level includes using dot notation. If you wanted to include the post for a comment and the post’s author as well you can do:
In order to use live queries, you need to set up both of them. The LiveQuery server should work with a Parse Server. The easiest way to setup the LiveQuery server is to make it run with the Parse Server in the same process. When you initialize the Parse Server, you need to define which Parse.Object classes you want to enable LiveQuery like this:
To use the FSAdapter, simply initialize your Parse Server in index.js by doing the following: When using parse-server-fs-adapter across multiple Parse Server instances it’s important to establish “centralization” of your file storage (this is the same premise as the other file adapters, you are sending/recieving files through a dedicated link).
Hello coders, today we are going to solve Attribute Parser HackerRank Solution in C++. This challenge works with a custom-designed markup language HRML. In HRML, each element consists of a starting and ending tag, and there are attributes associated with each tag. Only starting tags can have attributes.
According to this question in the Parse Community:
Instead of dot notation in whereKey:, you would use whereKey:matchesKey:inQuery: or whereKey:matchesQuery:.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With