@abejarano/ts-mongodb-criteria 1.6.1 → 1.6.2

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/README.md CHANGED
@@ -180,7 +180,7 @@ If you need a repository interface in your app, extend `IRepository<T>` so your
180
180
  custom interfaces stay aligned with the library return types:
181
181
 
182
182
  ```typescript
183
- import { IRepository } from "@abejarano/ts-mongodb-criteria"
183
+ import type { IRepository } from "@abejarano/ts-mongodb-criteria"
184
184
 
185
185
  export interface IUserRepository extends IRepository<User> {
186
186
  // Add domain-specific methods here
@@ -33,8 +33,10 @@ class MongoRepository {
33
33
  if (!result) {
34
34
  return null;
35
35
  }
36
- const { _id, ...rest } = result;
37
- return this.aggregateRootClass.fromPrimitives(rest);
36
+ return this.aggregateRootClass.fromPrimitives({
37
+ ...result,
38
+ id: result._id.toString(),
39
+ });
38
40
  }
39
41
  /** Upserts an aggregate by delegating to persist with its id. */
40
42
  async upsert(entity) {
@@ -30,8 +30,10 @@ export class MongoRepository {
30
30
  if (!result) {
31
31
  return null;
32
32
  }
33
- const { _id, ...rest } = result;
34
- return this.aggregateRootClass.fromPrimitives(rest);
33
+ return this.aggregateRootClass.fromPrimitives({
34
+ ...result,
35
+ id: result._id.toString(),
36
+ });
35
37
  }
36
38
  /** Upserts an aggregate by delegating to persist with its id. */
37
39
  async upsert(entity) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@abejarano/ts-mongodb-criteria",
3
3
  "author": "angel bejarano / angel.bejarano@jaspesoft.com",
4
- "version": "1.6.1",
4
+ "version": "1.6.2",
5
5
  "description": "Patrón Criteria para consultas MongoDB en TypeScript",
6
6
  "main": "dist/cjs/index.js",
7
7
  "module": "dist/esm/index.js",