Parse-server: Do LiveQuery subscriptions support queries derived from relations?

Created on 29 May 2016  Â·  3Comments  Â·  Source: parse-community/parse-server

This isn't an issue so much as a question: I've got live queries working fine with queries on parse objects, as in the example below.

    var testQuery = new Parse.Query('Test');
    var subscription = testQuery.subscribe();

But if I try to subscribe to a query derived from a relation, my event callbacks don't ever fire:

    var relation = user.relation('tests');

    // generate a query based on that relation
    var query = relation.query();
    var subscription = query.subscribe();

    subscription.on('enter', function(test){
      console.log('Info=\'Got subscription enter\' name=' + test.get('name'));
    });

Before I spend any more time on this, I thought I should ask - can I subscribe to queries derived from relations?

troubleshooting

All 3 comments

I think It's not cause I'm trying to subscribe to my relation's query. But It's giving me error.

+1

Same issue on basic usage:

    // Doesn't work
    var subscription = user.relation('receivedMessages').query().subscribe();

    // Work
    var subscription = new Parse.Query('receivedMessage').subscribe();

Apologize for closing this, but we want to make sure we stick to discussing actionable issues here in GitHub.

We want to make sure to keep signal strong in the GitHub issue tracker – to make sure that it remains the best place to track issues that affect the development of Parse Server.

Questions like yours deserve a purpose-built Q&A forum. Would you like to post this question to Stack Overflow with the tag #parse.com? We'll be happy to answer there. Post a link to your Stack Overflow question here, so that we don't lose track of it.

You may also use Server Fault for questions about managing your own servers.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mohmagdy picture mohmagdy  Â·  3Comments

AmbroiseCollon picture AmbroiseCollon  Â·  4Comments

jaydeep82 picture jaydeep82  Â·  4Comments

okaris picture okaris  Â·  4Comments

darkprgrmmr picture darkprgrmmr  Â·  4Comments