Meteor-Community-Packages / meteor-collection-hooks

Meteor Collection Hooks

Home Page:https://atmospherejs.com/matb33/collection-hooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

What would make .before.insert not fire?

polkhovsky opened this issue · comments

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.

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