@cocreate/mongodb 1.18.7 → 1.20.0
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 +19 -0
- package/package.json +1 -1
- package/prettier.config.js +16 -0
- package/src/index.js +12 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
# [1.20.0](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.19.0...v1.20.0) (2024-11-04)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* prettier.config options ([1cce40a](https://github.com/CoCreate-app/CoCreate-mongodb/commit/1cce40a4b8320418ff36a76ab4cf421960f9c6c7))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* add prettier.config.js and format files ([1baba2c](https://github.com/CoCreate-app/CoCreate-mongodb/commit/1baba2c4a8d97f315737e321e7f48193df970a22))
|
|
12
|
+
|
|
13
|
+
# [1.19.0](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.18.7...v1.19.0) (2024-11-02)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* allowDiskUse, set $storage, $database, $array if not included ([39a71d9](https://github.com/CoCreate-app/CoCreate-mongodb/commit/39a71d9c29b6432dae1951fcad1ce88e3fbe817e))
|
|
19
|
+
|
|
1
20
|
## [1.18.7](https://github.com/CoCreate-app/CoCreate-mongodb/compare/v1.18.6...v1.18.7) (2024-07-05)
|
|
2
21
|
|
|
3
22
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -302,9 +302,12 @@ function object(method, data) {
|
|
|
302
302
|
if (!Array.isArray($array))
|
|
303
303
|
$array = [data[type][i].$array]
|
|
304
304
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
305
|
+
if (!$storage.includes(data.storageName))
|
|
306
|
+
$storage.push(data.storageName)
|
|
307
|
+
if (!$database.includes(database))
|
|
308
|
+
$database.push(database)
|
|
309
|
+
if (!$array.includes(array))
|
|
310
|
+
$array.push(array)
|
|
308
311
|
|
|
309
312
|
delete data[type][i].$storage
|
|
310
313
|
delete data[type][i].$database
|
|
@@ -422,8 +425,12 @@ function object(method, data) {
|
|
|
422
425
|
|
|
423
426
|
dataTransferedOut += getBytes({ query, projection, sort, index, limit })
|
|
424
427
|
|
|
425
|
-
let document = ''
|
|
426
|
-
|
|
428
|
+
let cursor, document = ''
|
|
429
|
+
if (Object.keys(sort).length > 0)
|
|
430
|
+
cursor = arrayObj.find(query, projection).sort(sort).skip(index).limit(limit).allowDiskUse(true);
|
|
431
|
+
else
|
|
432
|
+
cursor = arrayObj.find(query, projection).sort(sort).skip(index).limit(limit);
|
|
433
|
+
|
|
427
434
|
if (!(await cursor.hasNext()) && method === 'update' && data.upsert)
|
|
428
435
|
document = { _id: ObjectId(data[type][i]._id) }
|
|
429
436
|
|