@atscript/moost-mongo 0.0.22 → 0.0.24
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/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -297,9 +297,9 @@ else pipeline.push({ $limit: 1e3 });
|
|
|
297
297
|
meta: [{ $count: "count" }]
|
|
298
298
|
} });
|
|
299
299
|
const result = await this.asCollection.collection.aggregate(pipeline).toArray();
|
|
300
|
-
const totalDocuments = result[0]
|
|
300
|
+
const totalDocuments = result[0]?.meta[0]?.count || 0;
|
|
301
301
|
return {
|
|
302
|
-
documents: result[0]
|
|
302
|
+
documents: result[0]?.documents || [],
|
|
303
303
|
page,
|
|
304
304
|
size,
|
|
305
305
|
totalPages: Math.ceil(totalDocuments / size),
|
package/dist/index.mjs
CHANGED
|
@@ -273,9 +273,9 @@ else pipeline.push({ $limit: 1e3 });
|
|
|
273
273
|
meta: [{ $count: "count" }]
|
|
274
274
|
} });
|
|
275
275
|
const result = await this.asCollection.collection.aggregate(pipeline).toArray();
|
|
276
|
-
const totalDocuments = result[0]
|
|
276
|
+
const totalDocuments = result[0]?.meta[0]?.count || 0;
|
|
277
277
|
return {
|
|
278
|
-
documents: result[0]
|
|
278
|
+
documents: result[0]?.documents || [],
|
|
279
279
|
page,
|
|
280
280
|
size,
|
|
281
281
|
totalPages: Math.ceil(totalDocuments / size),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atscript/moost-mongo",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "Atscript Mongo for Moost.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
"vitest": "3.2.4"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"@moostjs/event-http": "^0.5.
|
|
44
|
+
"@moostjs/event-http": "^0.5.32",
|
|
45
45
|
"mongodb": "^6.17.0",
|
|
46
|
-
"moost": "^0.5.
|
|
47
|
-
"@atscript/mongo": "^0.0.
|
|
48
|
-
"@atscript/typescript": "^0.0.
|
|
46
|
+
"moost": "^0.5.32",
|
|
47
|
+
"@atscript/mongo": "^0.0.24",
|
|
48
|
+
"@atscript/typescript": "^0.0.24"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"pub": "pnpm publish --access public",
|