Log when a mongo-specific action is being skipped #810
Labels
enhancement
Improve an existing Feature
not a typegoose issue
This is not a typegoose issue / This pr addresses something that shouldnt be in typegoose
Describe what you need | want
I was trying to execute the following update statement:
but it wouldn't give me any results. When I enabled logging, the query wasn't even being logged so nothing was executing.
I wasted 2 hours before I realized that this is "intended" behavior because the default
strict
option for a model istrue
and since Typegoose doesn't recognise$inc
as an existing property on my model, it is skipping this query entirely. Passing{ strict: false }
to this update fixed the "issue".It think it only makes sense that if a mongo-specific action (such as
$inc
) is not being executed because of thestrict
option, it should trigger a log message (if logging is enabled) so that the developer knows what is happening, because this is probably not the intended behaviour.Do you have already an idea for the implementation?
Sure, have a "whitelist" of actions that are checked when skipping properties and log it when there's a match.
But I do not have the time, nor do I know the codebase of Typegoose so I'm not volunteering to implement this myself. 🙂
The text was updated successfully, but these errors were encountered: