-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
.fields() doesn't work on ParseLiveQuery JS #1184
Comments
It should work as the keys are passed in here Does your live query return all keys? Can you write a test case? |
Will do! |
|
Thank you mate. I might have misunderstood the LiveQuery docs.
My thinking is that "update" should only fire when "name" is changed (if "fields" is selected). Is that correct? |
Interesting. I actually don't know. I was focused on this part.
I assumed it would function just like @parse-community/core-maintainers What should the proper implementation for this be? |
@dblythy Oh I see what you were trying to do in your example. |
In my use case, I am creating a LiveQuery on the _User class, but I only need updates on the "notificationCount" field, which is incremented on an afterSave trigger. I.e
I don't want the update event to fire when "firstName" / "email" is updated. I can easily compare originalObject and newObject but I was thinking fields would be more efficient to implicitly choose which keys you want to listen to changes in, restricting the amount of LQ messages being sent too. |
@dplewis what do you think about the addition of a few more LQ triggers, I could do something like:
I can't think of too many use cases where restricting the query using |
@parse-community/core-maintainers What do you guys think? |
I'd prefer to have an additional option in the current triggers for not broadcasting the change. Or, if stop the broadcasting is the use case, wouldn't be better to improve the current logic to not broadcast when not needed by default? |
Closing via parse-community/parse-server#6859 |
Not sure if this is an issue with Parse Server, or the JS SDK.
However, ParseLiveQuery server states:
subscriptionInfo.fields = request.query.fields
Yet I could not find any way to set
.fields
on the request query.I presume
.select
is intended for this, however I don't think ParseQuery ever passes.select()
to.fields
.My workaround for JS was to set
query.fields = ['']
.Happy to work on a PR if need be!
The text was updated successfully, but these errors were encountered: