diff --git a/changelog.md b/changelog.md index 564a5e9..a389412 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Changelog +## 2025-04-23 - 5.14.0 - feat(doc) +Implement support for beforeSave, afterSave, beforeDelete, and afterDelete lifecycle hooks in document save and delete operations to allow custom logic execution during these critical moments. + +- Calls beforeSave hook if defined before performing insert or update. +- Calls afterSave hook after a document is saved. +- Calls beforeDelete hook before deletion and afterDelete hook afterward. +- Ensures _updatedAt timestamp is refreshed during save operations. + ## 2025-04-22 - 5.13.1 - fix(search) Improve search query parsing for implicit AND queries by preserving quoted substrings and better handling free terms, quoted phrases, and field:value tokens. diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 7553638..d3dce4d 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartdata', - version: '5.13.1', + version: '5.14.0', description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.' } diff --git a/ts/classes.doc.ts b/ts/classes.doc.ts index f667b82..5356220 100644 --- a/ts/classes.doc.ts +++ b/ts/classes.doc.ts @@ -550,12 +550,16 @@ export class SmartDataDbDoc