fix(smartdata.classes.doc): Fix key handling in convertFilterForMongoDb function

This commit is contained in:
Philipp Kunz 2024-09-05 13:45:55 +02:00
parent 117c257a27
commit 64621dd38f
3 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,10 @@
# Changelog
## 2024-09-05 - 5.2.8 - fix(smartdata.classes.doc)
Fix key handling in convertFilterForMongoDb function
- Fixed an issue in convertFilterForMongoDb that allowed keys with dots which could cause errors.
## 2024-09-05 - 5.2.7 - fix(core)
Fixed issue with handling filter keys containing dots in smartdata.classes.doc.ts

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartdata',
version: '5.2.7',
version: '5.2.8',
description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.'
}

View File

@ -60,8 +60,7 @@ export const convertFilterForMongoDb = (filterArg: { [key: string]: any }) => {
convertedFilter[keyPathArg2] = filterArg2;
return;
} else if (key.includes('.')) {
convertedFilter[keyPathArg2] = filterArg2;
return;
throw new Error('keys cannot contain dots');
}
}
for (const key of Object.keys(filterArg2)) {