-
-
Notifications
You must be signed in to change notification settings - Fork 32
ParseQuery with ParseRelation #44
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
What's the actual structure of your data object(s)? And what's the JSON query that is being sent in the subscribe call? And does it work if you use
|
I did execute the query with This is the data structure: Class Message: My subscribtion: So with FindInBackground I get all objects in the relation, but with live query it is not working. |
No, I haven't - just wanted to address the first part before looking, because if the query itself doesn't work, the LiveQuery can never possibly work :) But according to parse-community/parse-server#2946, what you're asking for is not supported. I have personally tested and used One option: you may be able to change your objects so that instead of: class Channel {
ParseRelation<Message> getMessages() { return getRelation("messages"); }
}
class Message {} you can change it so the Message has a pointer to the Channel instead: class Channel { ... }
class Message {
Channel getChannel() { return (Channel) getParseObject("channel"); }
} and then your query and LiveQuery can use a Pointer reference, instead of a Relation reference: Channel myChannelObj = ...;
ParseQuery<Message> messagesQuery = ParseQuery.getQuery(Message.class).whereEqualTo("channel", myChannelObj);
// messagesQuery.find() should still work same as before
liveQuery.subscribe(messagesQuery); // then should work also. I know for certain that ParsePointer queries like this work, because my project does exactly this (and I made the commit that allows it to work correctly). |
Do you have the JSON string that is being sent for the ParseRelation query on subscribe? That might help track it down if the above isn't a solution. But given that the parse server issue is still open, saying this is not supported, the above alternative may be your only option. |
After I saw, that live query with ParseRelation is not working, I used the solution which you posted. Thank you for your quick response. :) |
Is livequery on parserelation not yet supported? |
Hey,
I wanted to do a live query operation with a ParseRelation.
Here is my code:
ParseRelation<ParseObject> relation = channel.getRelation("messages");
ParseQuery<ParseObject> query = relation.getQuery();
query.whereEqualTo("messageText", "test");
With this code I don´t get any response from server. If I do a query
without a relation, it works well.
Is ParseRelation not possible in association with LiveQuery?
Thanks in advance.
The text was updated successfully, but these errors were encountered: