Closed KoenLav closed 2 years ago
The issue is inside this ternary: https://github.com/Meteor-Community-Packages/meteor-collection-hooks/blob/63292cd900072bbd9e048d270f0cbd19def10f42/collection-hooks.js#L66
This package is using _collection which is a private interface in the server. The public collection interface already handles this for all updates in the underlying mongo driver.
If the choice is to keep using it your PR might solve it, but it's not future proof regarding nodejs drivers update ;)
Meteor's mongo@1.14.4 package fixes the behavior on _collection, so this issue should be solved. lmk if that's not the case
Both this._id and doc._id do not contain the correct ID of the recently inserted document in the after.insert callback.
For me it will always show 1, instead of the random string of _id which is in the database.
Related: https://github.com/meteor/meteor/pull/11867