Problem when trying to clone model #16888
Unanswered
lucassmcardoso
asked this question in
Help & Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello my fellows!
I've been having a problem when trying to use
structuredClone()
with querying methods such asfindAll()
. If I query withraw: true
the result doesn't come properly structured, while if I use withfalse
the cloning method returns the following error:Explaining the problem with
raw: true
: it returns a array with similar format to a SQL query. In other words, instead of havingA(id) -> [B(1), B(2), B(3)]
, I have it returned separated asA(id) -> [B(1)]
,A(id) -> [B(2)]
andA(id) -> [B(3)]
.Excuse me the notation, it was the best I could think of in a hurry. What I mean with the arrow is that an entity A has a field which is of type entity B[].
I would be very grateful if someone could help me with regards to this issue. Is deep cloning possible via the webAPI
structuredClone()
, while mantaining a coherent object structure?One last thing, I have been using the option
nest: true
in order to have the mapping to the model works correctly.Beta Was this translation helpful? Give feedback.
All reactions