Skip to content

LiveQuery with pointers or relations doesn't update. #422

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

Closed
facuparedes opened this issue Aug 20, 2020 · 3 comments
Closed

LiveQuery with pointers or relations doesn't update. #422

facuparedes opened this issue Aug 20, 2020 · 3 comments

Comments

@facuparedes
Copy link
Contributor

facuparedes commented Aug 20, 2020

Hi!
I'm using LiveQuery to get realtime changes. I have a class "Chat", with a relation column named "messages". So, I need to query by relations. I tried to do:

QueryBuilder _query = QueryBuilder<ParseObject>(ParseObject('Message'))..whereRelatedTo('messages', 'Chat', chatId)

However, I don't get any update from LiveQuery. (I think Parse-Server team didn't add this support to LiveQuery). Nevertheless, I saw this: #4231. So LiveQuery supports Pointers, that is why I added a pointer column in my class Message to my class Chat. Then I try to do:

QueryBuilder _queryChat = QueryBuilder<ParseObject>(ParseObject('Chat'))..whereEqualTo('objectId', chatId);
QueryBuilder _query = QueryBuilder<ParseObject>(ParseObject('Message'))..whereMatchesQuery('inChat', _queryChat)

But that doesn't work at all, I'm not getting any update from parse-server. Can you help me?

Greetings!!

@fischerscode
Copy link
Contributor

I do not know if this is really supported by the parse-server.

One message is typicaly in one chat. Have you considert using a pointer in the Message object to the Chat object?

In my application, I am using custom relation tables for relating objects of different classes with each other. And I had no problems with this approach, yet. (I think Parse-Server even works like this internaly. So maybe you could even query the existing, hidden class.)

@facuparedes
Copy link
Contributor Author

facuparedes commented Aug 22, 2020

I do not know if this is really supported by the parse-server.

One message is typicaly in one chat. Have you considert using a pointer in the Message object to the Chat object?

In my application, I am using custom relation tables for relating objects of different classes with each other. And I had no problems with this approach, yet. (I think Parse-Server even works like this internaly. So maybe you could even query the existing, hidden class.)

I fixed it using a Pointer in Message object to Chat object. Then using whereContainedIn, liveQuery works like a charm. Thanks u!

@MungaraJay
Copy link

Hey @FNPCMDs ,

I have similar issue, can you check it out and let me know how can i figure it out?
#424

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants