Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: only operate on simple objects in OrmUtils.mergeDeep
The mergeDeep functionality was causing issues where it would try to merge objects that were not safe to merge. to correct this we now only merge plain objects - such as those returned by createValueMap. there were three cases where the mongo driver had a split off code path where it passed in entities, so we've updated to instead update that to createValueMap as well
- Loading branch information
1 parent
db2f05d
commit 1d79b15
Showing
12 changed files
with
384 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
test/functional/mongodb/basic/repository-actions/entity/Counters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {Column} from "../../../../../../src/decorator/columns/Column"; | ||
import {Entity} from "../../../../../../src/decorator/entity/Entity"; | ||
import {User} from "./User"; | ||
|
||
@Entity() | ||
export class Counters { | ||
|
||
@Column({ name: "_likes" }) | ||
likes: number; | ||
|
||
@Column({ name: "_comments" }) | ||
comments: number; | ||
|
||
@Column({ name: "_favorites" }) | ||
favorites: number; | ||
|
||
@Column(() => User) | ||
viewer: User; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
test/functional/mongodb/basic/repository-actions/entity/User.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import {Column} from "../../../../../../src/decorator/columns/Column"; | ||
import {Entity} from "../../../../../../src/decorator/entity/Entity"; | ||
|
||
@Entity() | ||
export class User { | ||
|
||
@Column() | ||
name: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.