{"repo":"Meteor-Community-Packages/meteor-collection-hooks","free":true,"listed":false,"github":"https://github.com/Meteor-Community-Packages/meteor-collection-hooks","clone":"git clone https://github.com/Meteor-Community-Packages/meteor-collection-hooks.git","description":"Meteor Collection Hooks","language":"JavaScript","stars":656,"topics":["meteor","mongodb","collections","hooks","hacktoberfest"],"license":"MIT","category":"data-pipelines","readme_excerpt":"Meteor Collection Hooks Extends Mongo.Collection with before / after hooks for insert , update , remove , upsert , find , and findOne . Meteor 2.16+ & 3.x compatible with async hook support. Works across client, server or a mix. Also works when a client initiates a collection method and the server runs the hook, all while respecting the collection validators (allow/deny). Please refer to History.md for a summary of recent changes. Getting Started Installation: Meteor 3 Compatibility & Async Hooks Meteor Version Support: 2.16+ through 3.1+ Important Behavioral Changes in Meteor 3: Async Hooks Support As of v2.0.0, most hooks support async functions: Find Hooks Limitations Due to Meteor 3's synchronous find() method, find hooks have specific limitations: Hook Trigger Conditions findOne Hooks: find Hooks: -------------------------------------------------------------------------------- .before.insert(userId, doc) Fired before the doc is inserted. Allows you to modify doc as needed, or run additional functionality - this.transform() obtains transformed version of document, if a transform was defined. -------------------------------------------------------------------------------- .before.update(userId, doc, fieldNames, modifier, options) Fired before the doc is updated. Allows you to to change the modifier as needed, or run additional functionality. - this.transform() obtains transformed version of document, if a transform was defined. Important : 1. Note that we are changing modi","default_branch":null,"files":null,"tree":[],"storefront":"/r/Meteor-Community-Packages","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Meteor-Community-Packages/meteor-collection-hooks/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}