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
Song with the same id from the current Playlist is returned as Circular Object, that returns the playlist itself when accessed, after calling toJSON()
When I console log this object before calling toJSON(), the Song is shown correctly
When I console log this object after I called this.realm(Playlist).toJSON(), it returns the playlist itself
// '8' is the index of this Circular Objectconsole.log(realm.objects(Playlist)[0].songs[8])// Works fineconsole.log(realm.objects(Playlist).toJSON()[0].songs[8])// Returns the `Playlist` itself, instead of the `Song`
Steps to Reproduce
Create a Playlist containing an id equals to one of it's Songs.
Call toJSON()
RealmBot
changed the title
to-many Relationship returning Circular object
to-many Relationship returning Circular object
Oct 10, 2020
tavindev
changed the title
to-many Relationship returning Circular object
to-many Relationship returning Circular object after calling toJSON()
Oct 10, 2020
tavindev
changed the title
to-many Relationship returning Circular object after calling toJSON()
to-many Relationship returning Circular object when ids are them same
Oct 10, 2020
I currently have two schemas on my app:
Playlist
Song
Goals
Display a
Playlist
's songsExpected Results
Songs being displayed correctly
Actual Results
Song
with the same id from the currentPlaylist
is returned as Circular Object, that returns the playlist itself when accessed, after callingtoJSON()
When I console log this object before calling
toJSON()
, theSong
is shown correctlyWhen I console log this object after I called
this.realm(Playlist).toJSON()
, it returns the playlist itselfSteps to Reproduce
Create a
Playlist
containing an id equals to one of it'sSong
s.Call
toJSON()
Code Sample
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: