Closed emiljanitzek closed 2 years ago
@dsanel Can you please review and merge this PR.
While waiting for this PR to be approved we kept running into trouble with typescript and the type definitions. And the way methods are dynamically created and method signature was overridden made it really hard to work with this in typescript.
So we created a fork which we now published that is completely rewritten in typescript. The main concept is the same, but some interfaces/methods have changed and we removed some features and it does require mongoose 6 to work.
Feel free to check it out at https://github.com/emiljanitzek/mongoose-delete-ts.
We are migrating to mongoose but our
deletedBy/At
fields have different names and for legacy reasons, we can not change this right now. We also need the ability to use a custom getter to transform our value.This PR will added support for
deletedBy
anddeletedAt
deletedBy
anddeletedAt
(could make the currentdeletedByType
obsolete, can be replaced by{ deletedBy: { type: String } }
)?I was inspired by how mongoose handles the
timestamp
schema option. Let me know if you prefer another way. Will resolve issue #92