@livequery/mongoose 2.0.11 → 2.0.21

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.
@@ -198,7 +198,10 @@ export class MongoQuery {
198
198
  return p;
199
199
  return {
200
200
  ...p,
201
- [key]: fn()
201
+ [key]: {
202
+ ...p[key] || {},
203
+ ...fn()
204
+ }
202
205
  };
203
206
  }, $or.length > 0 ? { $or } : {});
204
207
  return [
@@ -323,7 +326,7 @@ export class MongoQuery {
323
326
  summary: mappers.length == 0 ? 1 : mappers.reduce((p, c) => {
324
327
  return {
325
328
  ...p,
326
- [c.name]: `$summary.${c.group_id}.${c.id}`
329
+ [c.name]: { $arrayElemAt: [`$summary.${c.group_id}.${c.id}`, 0] }
327
330
  };
328
331
  }, {}),
329
332
  items: {
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "repository": {
7
7
  "url": "git@github.com:livequery/mongoose.git"
8
8
  },
9
- "version": "2.0.11",
9
+ "version": "2.0.21",
10
10
  "description": "Mongoose datasource mapping for @livequery ecosystem",
11
11
  "main": "./build/src/index.js",
12
12
  "types": "./build/src/index.d.ts",