Meteor-Community-Packages / meteor-collection-hooks

Meteor Collection Hooks
https://atmospherejs.com/matb33/collection-hooks
MIT License
657 stars 92 forks source link

What would make .before.insert not fire? #182

Open polkhovsky opened 8 years ago

polkhovsky commented 8 years ago

I have this hook defined:

DealsCollection.before.insert(function (userId, doc) {
    console.log(doc);
    if (doc.priceDetails.startDate) {
        doc.priceDetails.startDateUTC = Meteor.call("makeUtcDate", doc.priceDetails.startDate);
    }   
});

It never fires. I have DealsCollection.after.insert that fires just fine. Looking for ideas. Thanks.

polkhovsky commented 8 years ago

It seems I can't do Meteor.call from inside the hook?