Replies: 1 comment 3 replies
-
Indeed it is different, on purpose, the question is whether it should be different in this particular case. I'd consider that as an internal method, or implementation detail if you want. Would be good if you can provide a repro that shows what you want and what you get instead of comparing ORM internals with other libraries. I will have a closer look later today, on first sight, it looks like something to fix The issue description sounds like you want to use custom classes in place of POJOs (although that is not part of the repro), for that you can extend the https://mikro-orm.io/docs/entity-helper#using-class-based-data |
Beta Was this translation helpful? Give feedback.
-
[Describe the bug]
In fact, I don't know the behavior is intended or not, maybe is by design?
I found the em.assign with JSON column will make the data strange,
So I dig source code found the result is merge by Mikro's Utils.merge
But it is different with other merge like function ex: lodash.merge, deepmerge
[To Reproduce]
https://codesandbox.io/p/sandbox/silly-rain-23jce0?file=%2Findex.js
You can see the log at right panel:
If origin data is not plain object, it won't be merge, source code here:
https://github.com/mikro-orm/mikro-orm/blob/master/packages/core/src/utils/Utils.ts#L291
[Expected behavior]
Merge result same with lodash.merge or deepmerge
[Additional context]
Again, maybe this is by mikro's design, if yes, plz forgive me and close this
Thanks your help!
[Versions]
Beta Was this translation helpful? Give feedback.
All reactions