Skip to content

Live query with include won't work #1686

Open

Description

@avielfedida

I have a table, one of the table fields points to the users table, here is my code:

var subscription = (new Parse.Query('Queue')).include('requestingUser').subscribe();
subscription.on('create', function(queueObject) {
    queueObject.get('requestingUser') // user object
    queueObject.get('requestingUser').get('name') // undefined
})

Within the parse server index.js I set:

liveQuery: {
    classNames: ["_User", "User", "Queue"] // Just in case I did try "_User" and "User"
}

I also tried another table, other than users table, doesn't work either.

This is the response(if it helps):

HTTP/1.1 201 Created
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Headers: X-Parse-Master-Key, X-Parse-REST-API-Key, X-Parse-Javascript-Key, X-Parse-Application-Id, X-Parse-Client-Version, X-Parse-Session-Token, X-Requested-With, X-Parse-Revocable-Session, Content-Type
Location: http://localhost:1337/parse/classes/Queue/cFwSWuzUXx
Content-Type: application/json; charset=utf-8
Content-Length: 64
Date: Sun, 01 May 2016 22:04:16 GMT
Connection: keep-alive

Honestly, I'm not sure if it's a bug but I was trying to find out if it's even possibly to use include with live query and didn't find anything like that in the docs, but the docs suggest that subscribe is just instead of find for example so I don't think include should be a problem and it is.

Activity

  1. chadpav commented on May 3, 2016

    @chadpav

    My understanding is that 'include' is not supported in LiveQuery yet. You will get back to the pointer information and can perform a fetch there or implement some local caching so you don't have to call the server to resolve those related records.

  2. avielfedida commented on May 3, 2016

    @avielfedida
    Author

    Currently I just use the pointer id the get the user I'm looking for via another query, so I didn't understand you perfectly, should I be able to use include or its not implemented yet(with LiveQuery)?

  3. chadpav commented on May 5, 2016

    @chadpav

    It's not implemented using Live Query. The way you are doing it is correct.

    My last comment was just a suggestion that you keep user records in a local cache so you don't always have to immediately fetch from the server every time.

  4. ronaldgalangy commented on May 26, 2017

    @ronaldgalangy

    Hi to all! Any update or support about include in LiveQuery?

  5. johncodeos commented on Jan 22, 2019

    @johncodeos

    Any news about that?

  6. dplewis commented on Jan 23, 2019

    @dplewis
    Member

    As @chadpav mentioned fetch the pointers or store them in local cache.

    Since LDS (LocalDataStore) has been added you could use that for include.

    @Jekos feel free to do a PR.

  7. johncodeos commented on Jan 23, 2019

    @johncodeos

    @dplewis I chose to go with @chadpav's method. Thanks.

  8. vdkdamian commented on Jan 6, 2023

    @vdkdamian

    I clearly see that there is interest in this topic. Is there a particular reason this won't work?
    Is it possible to fix this?

  9. reopened this on Jan 6, 2023
  10. parse-github-assistant commented on Jan 6, 2023

    @parse-github-assistant

    Thanks for opening this issue!

    • ❌ Please edit your post and use the provided template when creating a new issue. This helps everyone to understand your post better and asks for essential information to quicker review the issue.
  11. added
    type:featureNew feature or improvement of existing feature
    on Jan 6, 2023
  12. DarekDev commented on Jul 6, 2023

    @DarekDev

    This seems like a bit of random limitation that should not be there. Are there any plans to address this issue?

  13. mtrezza commented on Jul 6, 2023

    @mtrezza
    Member

    Does anyone want to open a PR?

  14. ssmagsk commented on Jul 10, 2025

    @ssmagsk

    Do we know what the status on this issue is or what the root cause entails?

  15. dplewis commented on Jul 10, 2025

    @dplewis
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:featureNew feature or improvement of existing feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions