You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the mongoose driver, when calling the method remove with a filter that would delete 0 records the callback is never called.
That's because of a piece of code in the mongoose adapter:
The remove method first executes a query with the required filters in order to get all the records to then delete them one by one and trigger the callback after removing the last one:
The problem is that when no record is found "data" is an array with length 0, which means that the code will enter the "if (data) " condition but never start the for cycle, which means that the callback won't be triggered
The text was updated successfully, but these errors were encountered:
Using the mongoose driver, when calling the method remove with a filter that would delete 0 records the callback is never called.
That's because of a piece of code in the mongoose adapter:
The remove method first executes a query with the required filters in order to get all the records to then delete them one by one and trigger the callback after removing the last one:
The problem is that when no record is found "data" is an array with length 0, which means that the code will enter the "if (data) " condition but never start the for cycle, which means that the callback won't be triggered
The text was updated successfully, but these errors were encountered: