vue-meteor-tracker icon indicating copy to clipboard operation
vue-meteor-tracker copied to clipboard

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

Open WayneUong opened this issue 7 years ago • 0 comments
trafficstars

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 avatar Nov 09 '18 21:11 WayneUong