Release history and updates for the node-mongo package.
escapeRegExp
option to service methods, enabling automatic escaping of $regex
filter values to prevent special characters from being interpreted as patterns.mongodb
dependency to v6.17.0 and updated related dependencies (mocha, @types/mocha, zod, etc.).mongodb
dependency from v4.10.0 to v6.1.0 (requires Node.js >=16.16.0).atomic.updateOne
and atomic.updateMany
now use readConfig
for query validation, ensuring consistent handling of soft-delete and query options.Service
and Database
classes for better type safety:
IDocument
now extends MongoDB’s Document
and requires _id: string
.<T extends IDocument>
).schemaValidator
in ServiceOptions
.CreateConfig
, ReadConfig
, UpdateConfig
, DeleteConfig
for more granular operation control.database.withTransaction
now uses default transaction options and better error handling.createdOn
, updatedOn
, deletedOn
) to use native Date
objects instead of ISO strings.service.find()
options page
and perPage
are now optional; defaults are set internally if omitted.eventBus.onUpdated
now supports generics for improved type safety.service.aggregate()
now returns an array of results directly.onUpdated('users', ...)
).validateSchema
option to validate
.addCreatedOnField
default to true
.addUpdatedOnField
default to true
.validateSchema
option to validate
.addCreatedOnField
default to true
.addUpdatedOnField
default to true
.generateId
method.expectDocument
method.update
method. Use updateOne or updateMany.ensureIndex
. Use atomic.createIndex.createOrUpdate
. Use create or updateOne or updateMany.findOneAndUpdate
. Use findOne and updateOne.useStringId
option.useStringId
option.atomic
namespace. See full listcreatedOn
and updatedOn
automatically to the model. If you want to save the current behavior, add the appropriate addCreatedOnField
and addUpdatedOnField
options to the service definitions.ensureIndex
of the monk
.