Closed GO-DIE closed 4 months ago
Hi, I was planning to add support for plain mongodb
at some point (or welcome a contribution).
In terms of mongoose
- I don't know if you're aware, but they offer a built-in transaction propagation with AsyncLocalStorage
(i.e. the very same thing that a @nestjs-cls/transactional
plugin would offer, so the only benefit would be the option to use the @Transactional
decorator)
Hi, I was planning to add support for plain
mongodb
at some point (or welcome a contribution).In terms of
mongoose
- I don't know if you're aware, but they offer a built-in transaction propagation withAsyncLocalStorage
(i.e. the very same thing that a@nestjs-cls/transactional
plugin would offer, so the only benefit would be the option to use the@Transactional
decorator)
Yes, I understand, but I don't think there is a conflict because mongoose's support for AsyncLocalStorage makes us easier to provide a transaction adapter for us to use the @Transactional decorator feature.
@GO-DIE Would you like to have a go at implementing it? I am definitely open to contributions.
I found some free time and put together a mongoose adapter. Feel free to test it for your use-case.
@nestjs-cls/transactional
>= 2.4.0
is required.
mongoose is a popular mongodb client package that is used by many people including myself, and I am eager to add an official transactional adapter to mongoose.