meteor-collection-hooks
meteor-collection-hooks copied to clipboard
Meteor Collection Hooks
I would like to create `auto-increment` in `_id` ```js async function getNextSequence(name) { const ret = await Counters.rawCollection().findOneAndUpdate( { _id: name }, { $inc: { seq: 1 } }, {...
with objects for _id the return of doc._id after insert is of the type "new ObjectId("964b098402035b3de292d00f")" meteor : [email protected] matb33:[email protected] mongo server version 4.2
I have noticed that when calling `Collection.update` with `{ multi: true }` set as an option, the `collection.before.update` hook is called once per document, however, the modifier parameter is the...
What would be a simple way to attach hooks to raw collections (except by redefining collection.find, etc...) I really would like to use this package on mongodb raw collections.
To repoduce: 1. Add first hook (before.update) 2. Add second hook (before.update) 3. remove first hook 4. remove second hook 5. update a entry --> second hook is called. Problem...
When updating a document using direct ```Collection.direct.update()``` previous is still fetched with just the _id. This behaviour doesnt make sense, as it should completely bypass the hooks functionalities. This causes...
This PR makes two changes: 1. A bug fix: If you define any after hooks, the before hook will fetch the previous document, even if `fetchPrevious` is set to false....
Many times in a `before.update` I'll check the incoming `modifier` and update it to enforce application rules. A perfect example is sanitizing HTML from a rich-text editor before saving. Simply...
Maybe this is already possible with the current hooks, but I'm not entirely sure: I'd like all of our limited/skipped mongo queries to also return the total count, without having...