- Fix bug in upsert hook
after.update
not returning manipulated fields #258 @SimonSimCity
- Modernization of the package
- BREAKING CHANGE: Minimum required Meteor version is now 1.7.0.5
- Fixed selector not being able to be modified when String or MongoID is used
- Add
npm prune --production
to publication script to prevent addition of dev only packages to the bundle. Fixes issue #246
- BREAKING CHANGE: Minimum required Meteor version is now 1.6.1
- Fix unsafe
selector
inbefore.find
andbefore.findOne
when called without arguments. This is potentially a BREAKING CHANGE for those who are relying on the current behavior ofselector
inbefore.find
andbefore.findOne
- Align return values with original methods when a hook returns
false
- Always run
find
hooks when fetching documents forupdate
,upsert
andremove
hooks - Add support for update/upsert hooks to run on a different selector based on custom options when used together with a find hook that manipulates the selector based on custom options
- Fix Meteor.publish override, the previous override resulted in false positives of autopublish warning
- Use spacejam for headless testing, will make headless testing work locally
- Add support for the new modifiers $max, $min and $currentDate
- No longer fetch documents when no hooks are defined
- Fix conflict with sewdn:collection-behaviours package
- Updated dependencies and node version in tests
- If an async upsert operation returns an error, funnel it to the after.insert hook, fixes Meteor-Community-Packages#185
- Add a note in the README concerning the use of
find
inupdate
andremove
, closes Meteor-Community-Packages#191 - Handle mongo object _id (with result, ops, etc) in after insert by extracting the _id from ops, fixes meteor/meteor#7409
- Provide helper CollectionHooks.modify that gives the developer server access to the typically client-only LocalCollection._modify
- Fix doc having only _id property in after.insert triggered by an upsert when using $set, fixes Meteor-Community-Packages#156
- Add support for
upsert
hooks. This is potentially a breaking change for those relying onbefore.update
forupsert
, as the behavior has changed to firebefore.upsert
instead, and eitherafter.insert
orafter.update
depending on the outcome of the upsert operation
- When creating a sub-class of Mongo.Collection, the constructor of the sub-class will now be able to inherit from the wrapped constructor
- Throwing an error in an async before hook will pass the error to the callback as the first argument
- Setting fetchPrevious to false should not prevent cloning options and modifier for use in after update hooks, fixes Meteor-Community-Packages#97 and Meteor-Community-Packages#138
- Move getUserId utility function to globally accessible CollectionHooks.getUserId
- Fix typo in update advice, where the local variable docIds was declared as docsIds and thus docIds was being leaked into global scope, causing weird side-effects as experienced in Meteor-Community-Packages#109 (comment)
- Add MIT license file
- Fix update and insert by string _id (Meteor-Community-Packages#89 and likely Meteor-Community-Packages#90)
- Add tests to verify direct update and insert by string _id (Meteor-Community-Packages#89)
- Set api.versionsFrom to 1.0.3
- Add tests to verify hook functionality against CollectionFS (Meteor-Community-Packages#84)
- Fix instances of direct calls returning raw data instead of the massaged versions (such as insert returning an object instead of _id) (Meteor-Community-Packages#86, Meteor-Community-Packages#73)
- Remove bind polyfill (Meteor-Community-Packages#77)
- Use versionsFrom 0.9.1
- Fix
new Meteor.Collection
so as not to have to re-assign prototype
- Fix backward compatibility issue (meteor/meteor#2549)
- Update for Meteor 0.9.1
- Update for Meteor 0.9
- Store the value of
this.userId
from aMeteor.publish
function in an environment variable so it is preserved across yielding operations
- Allow specifying hook options on a per-collection basis
- Fix direct implementation and associated tests (#46)
- Implement second parameter
options
for all hooks (coll.before.update(func, {option: 123})
) - Add global
CollectionHooks.defaults
to specify options that apply to all or specific hooks - Add
fetchPrevious
option, which must be set tofalse
to prevent fetchingthis.previous
(which can also be set via globalCollectionHooks.defaults
) (#41)
- Eliminate unnecessary reduction in performance from iterating through individual documents when no hooks are defined. (#38)
- Add automated testing and additional tests for
userId
in publish functions. (#21) - Add functions for direct operations on underlying collection, ignoring hooks. (#3)
- Update argument/input logic of hooks for better compatibility with other packages. (#24)