@mikro-orm/mongodb 7.2.9-dev.1 → 7.2.9-dev.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.
Files changed (2) hide show
  1. package/MongoDriver.js +3 -0
  2. package/package.json +2 -2
package/MongoDriver.js CHANGED
@@ -255,6 +255,8 @@ export class MongoDriver extends DatabaseDriver {
255
255
  res.row = { _id: res.insertId };
256
256
  return res;
257
257
  }
258
+ // work on a copy, `em.upsert()` builds the entity from the caller's data and must not see the `$inc`
259
+ data = { ...data };
258
260
  this.handleVersionProperty(entityName, data, true);
259
261
  data = this.renameFields(entityName, data);
260
262
  where = this.renameFields(entityName, where, true);
@@ -281,6 +283,7 @@ export class MongoDriver extends DatabaseDriver {
281
283
  return row;
282
284
  });
283
285
  data = data.map(row => {
286
+ row = { ...row };
284
287
  this.handleVersionProperty(entityName, row, true);
285
288
  return this.renameFields(entityName, row);
286
289
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikro-orm/mongodb",
3
- "version": "7.2.9-dev.1",
3
+ "version": "7.2.9-dev.2",
4
4
  "description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
5
5
  "keywords": [
6
6
  "data-mapper",
@@ -53,7 +53,7 @@
53
53
  "@mikro-orm/core": "^7.2.8"
54
54
  },
55
55
  "peerDependencies": {
56
- "@mikro-orm/core": "7.2.9-dev.1"
56
+ "@mikro-orm/core": "7.2.9-dev.2"
57
57
  },
58
58
  "engines": {
59
59
  "node": ">= 22.17.0"