williamkapke / mongo-mock

Let's pretend we have a real MongoDB
MIT License
240 stars 75 forks source link

deleteMany doesn' work #159

Open LucVidal360 opened 1 year ago

LucVidal360 commented 1 year ago

Problem

It seems deleteMany never deletes anything. Indeed, it's algorithm is:

Unfortunately

This means ids never match (because they are not the same instance of ObjectIds), and nothing is ever deleted.

Possible fix

A solution could be to add a secret option to cursor to avoid cloning documents. To use only with deleteMany.