-
-
Notifications
You must be signed in to change notification settings - Fork 205
How to query and include parent object in child query #357
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
In your screenshot the pointer is called "_p_parent" in your query it's called "parent".
|
Output:
No effect. |
Have you tried to query manually through the rest API? |
Yes I tried that and it looks like it works using REST API. Thank you. Here is the URL- Here is the response-
This is what I using hoping would be the response using the SDK. Now this a bug in the Parse SDK right? |
As the rest API works, it has to be a problem with the SDK, I think. Could you please add
after your
and try to query the printed URL through the REST API? |
Here is the output:
However when I use the generated Url in Postman: The response includes the parent details |
Please try this:
It might be related to your custom class. EDIT: |
Tried the above query- Still the same response with no details Also got an exception-
Also the method registerSubClass isn't defined for ParseCoreData. What should I do for using subclasses? |
Are you just calling registerSubClass is currently not available in this repo. I am working on such a feature, but as it is quite a huge change, we decided to add it after I have used/tested it for a while. (#350 (comment)) Edit: Edit2:
As the query currently does not know about PollLike, this makes sens. |
Yup just calling queryBuilder.query(); I am using version - 1.0.26 |
I might have found the problem... |
Please try this query again:
and have a look into the object trough the debugger. Inside the debugger you should see the included object. |
I changed the Poll type in PollLike to ParseObject
Some checks
Output:
It has the ParseObject with details and I can access it using I created a class for OfficialPolls
Then I tried to type cast
Which fails as it is not a subtype of ParseObject Is there any way to convert it to OfficialPoll type even using some of the existing SDK code? |
Found the way to convert the ParseObject in PollLike to Official Type
Output of the above code-
instead of
also works So I used the clone function which needs a map |
So you are doing something like this now? Does now everything work? |
Nope
|
I have two classes -
PollLike and Poll
The PollLike is like child of the poll object
Each class represents two classes in the Actual database.
Poll - OfficialPolls and UserPolls
PollLike - OfficialPollLikes and UserPollLikes
Now I save a OfficialPollLike with an official poll -
OfficialPollLike stores a pointer to the OfficialPoll object
Now, I want to retrieve OfficialPollLikes of a particular user with the Poll details already included in the response-
Here is the response-
It does not contain any fields of the Poll class except the pointer.
I am also new to Pointers and Relation on Parse SDK.
The text was updated successfully, but these errors were encountered: