@cocreate/mongodb
Advanced tools
Comparing version 1.1.1 to 1.1.2
@@ -0,1 +1,9 @@ | ||
## [1.1.2](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.1.1...v1.1.2) (2022-12-13) | ||
### Bug Fixes | ||
* bump dependencies ([fcf95de](https://github.com/CoCreate-app/CoCreate-mongodb/commit/fcf95de70fbfeba97f4d313ed0b8134a4496cca2)) | ||
* supports operator includes and $includes ([d63e4a4](https://github.com/CoCreate-app/CoCreate-mongodb/commit/d63e4a48cba168955b71430c6a7a465849388cc0)) | ||
## [1.1.1](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.1.0...v1.1.1) (2022-12-12) | ||
@@ -2,0 +10,0 @@ |
{ | ||
"name": "@cocreate/mongodb", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A simple mongodb component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.", | ||
@@ -64,7 +64,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@cocreate/docs": "^1.4.18", | ||
"@cocreate/hosting": "^1.6.17", | ||
"@cocreate/utils": "^1.16.0", | ||
"@cocreate/docs": "^1.4.19", | ||
"@cocreate/hosting": "^1.6.18", | ||
"@cocreate/utils": "^1.16.2", | ||
"mongodb": "^4.12.1" | ||
} | ||
} |
@@ -625,6 +625,13 @@ const {MongoClient, ObjectId} = require('mongodb'); | ||
if (filter.sort) | ||
for (let i = 0; i < filter.sort.length; i++) | ||
if (filter.sort) { | ||
for (let i = 0; i < filter.sort.length; i++) { | ||
let direction = filter.sort[i].direction | ||
if (direction == 'desc' || direction == -1) | ||
direction = -1; | ||
else | ||
direction = 1; | ||
sort[filter.sort[i].name] = filter.sort[i].direction | ||
} | ||
} | ||
return {query, sort} | ||
@@ -651,2 +658,3 @@ } | ||
case '$includes': | ||
case 'includes': | ||
query[key]['$regex'] = item.value; | ||
@@ -665,2 +673,4 @@ break; | ||
case 'equals': | ||
query[$eq][item.operator] = item.value; | ||
case '$eq': | ||
@@ -667,0 +677,0 @@ case '$ne': |
46335
752
Updated@cocreate/docs@^1.4.19
Updated@cocreate/hosting@^1.6.18
Updated@cocreate/utils@^1.16.2