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

findOne(_id) cursors do not work with meteor collection hooks #45

Open
WayneUong opened this issue Nov 9, 2018 · 0 comments
Open

findOne(_id) cursors do not work with meteor collection hooks #45

WayneUong opened this issue Nov 9, 2018 · 0 comments

Comments

@WayneUong
Copy link

WayneUong commented Nov 9, 2018

I use a few before.find and before.findOne hooks from https://github.com/matb33/meteor-collection-hooks. And they only work outside of the vue meteor tracker. E.g.

If I have hook:

Projects.before.findOne(function (userId, selector, options) {
    selector.removed = null
});

This will work:

methods: {
    findProject () {
        return Projects.findOne('xyz')
    }
}

This will work:

meteor: {
    project () {
        return Projects.findOne({_id: 'xyz'});
    }
}

This will not work:

meteor: {
    project () {
        return Projects.findOne('xyz');
    }
}
@WayneUong WayneUong changed the title Cursors do not work with meteor collection hooks findOne(_id) cursors do not work with meteor collection hooks Nov 9, 2018
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