Closed stearm closed 2 years ago
Would be useful if hooks also got db instance itself for manipulation, just the document id is not overly useful as there isn't a way to access db inside the hook (as far as I know 😅 ).
That's expected. Hooks are still experimental, if we merge it into insert
we would need to change its signature to return always a Promise, which is a breaking change.
We're evaluating a better approach and this likely will be refactored any time soon. By the way, would be great to see your use-cases using Hooks.
Closing this as Rafael's answer explains it 🙂
Since the insert and the insertWithHooks are more or less the same functions, I'm wondering if it's worth adding a field inside the InsertConfig type like:
and update the
insert
function like this:Maybe it's too early to do this kind of refactoring but why not discuss it! 😄