@cocreate/mongodb 1.12.1 → 1.12.3

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 CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.12.3](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.12.2...v1.12.3) (2023-11-18)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * operator ([15a617e](https://github.com/CoCreate-app/CoCreate-mongodb/commit/15a617eec39db3d1b67c2fe0221f6340112e43ed))
7
+
8
+ ## [1.12.2](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.12.1...v1.12.2) (2023-11-18)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * handling of $nin operator ([56cbd21](https://github.com/CoCreate-app/CoCreate-mongodb/commit/56cbd21d3ff2c52da3477eba4a9090372954be1e))
14
+
1
15
  ## [1.12.1](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.12.0...v1.12.1) (2023-11-12)
2
16
 
3
17
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/mongodb",
3
- "version": "1.12.1",
3
+ "version": "1.12.3",
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",
package/src/index.js CHANGED
@@ -695,12 +695,18 @@ function createQuery(queries) {
695
695
  query[key][item.operator] = item.value;
696
696
  break;
697
697
  case '$in':
698
- case '$nin':
699
698
  if (!Array.isArray(item.value))
700
- query[key] = [item.value]
699
+ query[key][item.operator] = [item.value]
701
700
  else
702
701
  query[key] = { $in: item.value }
703
702
  break;
703
+
704
+ case '$nin':
705
+ if (!Array.isArray(item.value))
706
+ query[key][item.operator] = [item.value]
707
+ else
708
+ query[key] = { $nin: item.value }
709
+ break;
704
710
  case '$or':
705
711
  if (!query[item.operator])
706
712
  query[item.operator] = [{ [key]: item.value }];