@cocreate/mongodb 1.18.5 → 1.18.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/index.js +16 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.18.6](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.18.5...v1.18.6) (2024-07-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* handling objectId in queries ([58c92b2](https://github.com/CoCreate-app/CoCreate-mongodb/commit/58c92b259da510e8020ff9211c72ce678905aceb))
|
|
7
|
+
|
|
1
8
|
## [1.18.5](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.18.4...v1.18.5) (2024-07-01)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -652,10 +652,16 @@ async function createFilter(data, arrayObj) {
|
|
|
652
652
|
if (typeof condition[subKey] === 'object' && condition[subKey] !== null) {
|
|
653
653
|
newCondition[subKey] = {};
|
|
654
654
|
for (let subCondition in condition[subKey]) {
|
|
655
|
-
|
|
655
|
+
if (subKey == "_id")
|
|
656
|
+
newCondition[subKey][subCondition] = ObjectId(condition[subKey][subCondition])
|
|
657
|
+
else
|
|
658
|
+
newCondition[subKey][subCondition] = convertIfDate(condition[subKey][subCondition]);
|
|
656
659
|
}
|
|
657
660
|
} else {
|
|
658
|
-
|
|
661
|
+
if (subKey == "_id")
|
|
662
|
+
newCondition[subKey] = ObjectId(condition[subKey])
|
|
663
|
+
else
|
|
664
|
+
newCondition[subKey] = convertIfDate(condition[subKey]);
|
|
659
665
|
}
|
|
660
666
|
}
|
|
661
667
|
return newCondition;
|
|
@@ -664,11 +670,17 @@ async function createFilter(data, arrayObj) {
|
|
|
664
670
|
// Handle general object conditions
|
|
665
671
|
query[key] = {};
|
|
666
672
|
for (let condition in data.$filter.query[key]) {
|
|
667
|
-
|
|
673
|
+
if (key == "_id")
|
|
674
|
+
query[key][condition] = ObjectId(data.$filter.query[key][condition])
|
|
675
|
+
else
|
|
676
|
+
query[key][condition] = convertIfDate(data.$filter.query[key][condition]);
|
|
668
677
|
}
|
|
669
678
|
} else {
|
|
670
679
|
// Handle direct values
|
|
671
|
-
|
|
680
|
+
if (key == "_id")
|
|
681
|
+
query[key] = ObjectId(data.$filter.query[key])
|
|
682
|
+
else
|
|
683
|
+
query[key] = convertIfDate(data.$filter.query[key]);
|
|
672
684
|
}
|
|
673
685
|
}
|
|
674
686
|
}
|