-
-
Notifications
You must be signed in to change notification settings - Fork 206
How to perform relational queries with Pointers? #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Add .included next(ParseUser) to your search.
…On Mon, Jan 21, 2019, 21:49 Carlos Eugenio Torres ***@***.*** wrote:
I have a class Customer that has a property user. That's a Pointer to
User. How can I perform a query that does this where?
where={"user":{"__type":"Pointer","className":"_User","objectId":"8TOXdXf3tz"}}
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#51>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AHgn3pB0pez6okkDOrrLDtsdkOAW8Owrks5vFjXmgaJpZM4aLk8P>
.
|
Can you give an example, please? |
There is an example in the example app.
Main.dart
…On Mon, Jan 21, 2019, 22:05 Carlos Eugenio Torres ***@***.*** wrote:
Can you give an example, please?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgn3lxncX6pilvLmHHXGcFl-wqpm4wpks5vFjmSgaJpZM4aLk8P>
.
|
I saw that one: .includeObject(['Day']). But that just includes the Pointer data into the main query. But doesn't filter by the objectId, which is what I want. With this request I can achieve the query: But how to do it with the QueryBuilder? Now I can only do with custom query from the ParseObject. |
Add whereEquals(objectId) to the query?
…On Mon, Jan 21, 2019, 22:12 Carlos Eugenio Torres ***@***.*** wrote:
I saw that one: .includeObject(['Day']). But that just includes the
Pointer data into the main query. But doesn't filter by the objectId, which
is what I want.
There query is like, give me the customers from this user.
With this request I can achieve the query:
https://YOUR.PARSE-SERVER.HERE/parse/classes/Customer?where={"user":{"__type":"Pointer","className":"_User","objectId":"8TOXdXf3tz"}}
But how to do it with the QueryBuilder? Now I can only do with custom
query from the ParseObject.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgn3tZCQodAedz-VgXaZAog5mm32TiUks5vFjtbgaJpZM4aLk8P>
.
|
No. It would be using whereEqualTo('user', user). Sending the user as a ParseUser doesn't work. I believe because Parse stores this user on Customer class as a Pointer to User. So it's a Pointer object. So the solution would be perform a subquery, as the REST API suggests, do a inQuery: &where={"user":{"$inQuery":{"where":{"objectId":"${user.get('objectId')}"},"className":"_User"}}} But I don't see any method to do find an object as a result of a query. On the regular Parse SDK for iOS and Android we can find it. |
Can you send me the section of the REST API you are referring too. I don't
understand.
…On Mon, Jan 21, 2019, 22:40 Carlos Eugenio Torres ***@***.*** wrote:
No. It would be using whereEqualTo('user', user). Sending the user as a
ParseUser doesn't work. I believe because Parse stores this user on
Customer class as a Pointer to User. So it's a Pointer object. So the
solution would be perform a subquery, as the REST API suggests, do a
inQuery:
&where={"user":{"$inQuery":{"where":{"objectId":"${user.get('objectId')}"},"className":"_User"}}}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgn3t7F2ySJ768vrcuuyuRsqtSdRQx4ks5vFkHqgaJpZM4aLk8P>
.
|
I see.
This feature has not been added yet. It will be in the near future.
…On Mon, Jan 21, 2019, 22:44 Carlos Eugenio Torres ***@***.*** wrote:
https://docs.parseplatform.org/rest/guide/#relational-queries
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHgn3pjjpAM9_OQNK6ozvV6vpedOEDRIks5vFkLMgaJpZM4aLk8P>
.
|
Ah ok, good to know. Thank you. |
@cetorres
|
@phillwiggins Resolved in the last release. |
Thank you, guys! |
@cetorres |
Yes, @RodrigoSMarques. You too? |
Me too. I live in Vitória - ES. Nice. I speak. I know a few Brazilians who use Parse. |
@phillwiggins |
I have a class Customer that has a property user. That's a Pointer to User. How can I perform a query that does this where?
where={"user":{"__type":"Pointer","className":"_User","objectId":"8TOXdXf3tz"}}
The text was updated successfully, but these errors were encountered: