You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with a complex nested structure in Realm using embedded objects. I'm struggling to find an efficient and clean way to update this structure with new data from a JavaScript object.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Problem Description
I'm working with a complex nested structure in Realm using embedded objects. I'm struggling to find an efficient and clean way to update this structure with new data from a JavaScript object.
Current Schema Structure
Where
UserDbModel
is a class for a regular Realm schema, and the others are classes for embedded Realm schemas.Goal
I want to update the
bio
field ofUserDbModel
with a new regular JavaScript object that matches this structure.Attempted Solutions
Direct assignment in a write transaction:
Using
realm.create()
to create a new embedded object:Neither of these approaches work as expected.
Current Considerations
Questions
realm.create()
or a similar method that works with embedded objects?Environment
Any insights or solutions would be greatly appreciated. Thank you!
Beta Was this translation helpful? Give feedback.
All reactions