@cocreate/mongodb 1.12.0 → 1.12.2
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 +15 -0
- package/package.json +2 -2
- package/src/index.js +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [1.12.2](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.12.1...v1.12.2) (2023-11-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* handling of $nin operator ([56cbd21](https://github.com/CoCreate-app/CoCreate-mongodb/commit/56cbd21d3ff2c52da3477eba4a9090372954be1e))
|
|
7
|
+
|
|
8
|
+
## [1.12.1](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.12.0...v1.12.1) (2023-11-12)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* bump dependencies for latest features ([704750a](https://github.com/CoCreate-app/CoCreate-mongodb/commit/704750af769d95e78535221ed9bf92a2aa20b1fd))
|
|
14
|
+
* removed limit = index + limit ([c085917](https://github.com/CoCreate-app/CoCreate-mongodb/commit/c085917d06c6017298b6c09f974015b22341a404))
|
|
15
|
+
|
|
1
16
|
# [1.12.0](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.11.0...v1.12.0) (2023-11-09)
|
|
2
17
|
|
|
3
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cocreate/mongodb",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.2",
|
|
4
4
|
"description": "A simple mongodb component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mongodb",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"main": "./src/index.js",
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@cocreate/utils": "^1.
|
|
48
|
+
"@cocreate/utils": "^1.27.1",
|
|
49
49
|
"mongodb": "^4.12.1"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/src/index.js
CHANGED
|
@@ -630,8 +630,6 @@ async function createFilter(data, arrayObj) {
|
|
|
630
630
|
index = data.$filter.index
|
|
631
631
|
if (data.$filter.limit)
|
|
632
632
|
limit = data.$filter.limit
|
|
633
|
-
if (limit)
|
|
634
|
-
limit = index + limit;
|
|
635
633
|
}
|
|
636
634
|
|
|
637
635
|
if (data['organization_id'])
|
|
@@ -699,9 +697,9 @@ function createQuery(queries) {
|
|
|
699
697
|
case '$in':
|
|
700
698
|
case '$nin':
|
|
701
699
|
if (!Array.isArray(item.value))
|
|
702
|
-
query[key] = [item.value]
|
|
700
|
+
query[key][item.operator] = [item.value]
|
|
703
701
|
else
|
|
704
|
-
query[key] = { $
|
|
702
|
+
query[key] = { $nin: item.value }
|
|
705
703
|
break;
|
|
706
704
|
case '$or':
|
|
707
705
|
if (!query[item.operator])
|