Skip to content
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

client find, server added->ready->changed does not trigger query update #92

Open
jerradpatch opened this issue Apr 13, 2017 · 1 comment

Comments

@jerradpatch
Copy link

maybe I am misunderstanding how find should with with RXJS in Meteor.

if I have this on the client

Models

find(type): Observable<any[]> {
    return this.Models.find({});
}
constructor(){
MeteorObservable.subscribe('testCollection').subscribe();
this.Models = new MongoObservable.Collection<any>('testPublisher', {idGeneration: 'MONGO'});
}

and this on the server

Meteor.publish('testPublisher', function () {
    this.added('testCollection', 'testId', {doc: []});
    this.ready();
    this.changed('testCollection', 'testId', {doc: [{test:'test'}]});
})

shouldn't the 'this.changed' trigger the find results to return the updated model in the find query? However, I am only ever receiving the initial model from 'this.added'.

Thanks

@jerradpatch
Copy link
Author

jerradpatch commented Apr 13, 2017

cant even seem to get the changed doc even if I call,

let docs = new Subject();
        let sub = this.Models.find({})
            .observe({
                added(document, atIndex, before){
                    docs.next(document);
                },
                changed(newDocument, oldDocument)  {
                    docs.next(newDocument);
                }
            });

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

1 participant