The release includes a lot of changes to make sure that the package is compatible with the latest MongoDB version. Most notable changes:
- Rewritten in typescript
- Removed monk dependency.
- Added mongodb native Node.JS sdk as dependency.
- Added support for transactional events using transactional outbox pattern
- Introduced shared in-memory events bus. It should be used to listen for CUD updates.
- Add emitter option.
- Update dependencies.
- Rename
validateSchema
option tovalidate
. - Change
addCreatedOnField
default totrue
. - Change
addUpdatedOnField
default totrue
.
- Rename
validateSchema
option tovalidate
. - Change
addCreatedOnField
default totrue
. - Change
addUpdatedOnField
default totrue
.
- Remove
generateId
method. - Remove
expectDocument
method.
- Remove
update
method. Use updateOne or updateMany. - Remove
ensureIndex
. Use atomic.createIndex. - Remove
createOrUpdate
. Use create or updateOne or updateMany. - Remove
findOneAndUpdate
. Use findOne and updateOne.
- Add
useStringId
option.
- Add
useStringId
option.
- Add more monk's methods. See full list
- Add generateId method.
- Add updateOne method.
- Add updateMany method.
- Add performTransaction method.
- Add more monk's methods in
atomic
namespace. See full list
- Update dependencies.
- Fix required version of the Node.js.
- Now
update
function will work via set operator. It means the new doc will be the result of merge of the old doc and the provided one.
- Update dependencies.
- Add tests.
- Fix required version of the Node.js.
- Now, by default, we do not add the fields
createdOn
andupdatedOn
automatically to the model. If you want to save the current behavior, add the appropriateaddCreatedOnField
andaddUpdatedOnField
options to the service definitions.
- Stop using deprecated method
ensureIndex
of themonk
.
- Add ability to create custom methods for service and query service.
- Add tests.
- Add support of the joi for validating data schema.
- Add tests for validating of the schema.