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
Describe the bug
I received this notice from MongoDB Realm Studio 11.1.1 when clicking on a class and am not sure what it means or what to do about it. I cannot view any of the objects in that class
Converting circular structure to JSON → starting at object with constructor ‘Object’ | property ‘embedded_dog_list’ → object with constructor ‘Array’ | index 0 → object with constructor ‘Object’ — property ‘parent_object’ closes the circle
To Reproduce
Here's the object structure. Note this does NOT occur on a freshly minted Realm file with no data. It only occurs after data is written.
There’s a parent Person object with embedded Dog objects (as a List), and then a City class which points back to the embedded dog list.
class PersonClass: Object {
@Persisted var embedded_dog_list: List<EmbeddedDogClass>
and the embedded dogs look like this:
class EmbeddedDogClass: EmbeddedObject {
@Persisted var name = ""
@Persisted var parent_object: AnyRealmValue = .none
@Persisted var linked_city: CityClass!
and the City class
class CityClass: Object {
@Persisted(originProperty: "linked_city") var linkedEmbeddedDogs: LinkingObjects<EmbeddedDogClass>
The idea here is the Persons have dogs. At the same time I want to know a person via the dog in a city. e.g. I can pull up a city, and get a list of dogs in that city, and also, through the parent_object field, know their person. (There are different types of owners, Person being one of them, which is why I used AnyRealmValue)
When loading a Person in code and printing it to console, everything looks normal and all values are as expected
Expected behavior
Show the objects of the class when clicking on the class?
Versions:
OS: macOS 12.0.1
Realm Studio: 11.1.1 (11.1.1.42)
SDK 10.21.0 through 10.24.0
The text was updated successfully, but these errors were encountered:
I think the issue it that our cycle detection doesn't take AnyRealmValue into account. If it is possible for you, we would appreciate if you can verify that it works if you change the type of parent_object to PersonClass.
Yes, changing the parent_object property of the EmbeddedDogClass to a PersonClass works correctly.
class EmbeddedDogClass: EmbeddedObject {
@Persisted var name = ""
//@Persisted var parent_object: AnyRealmValue = .none
@Persisted var parent_object: PersonClass! <- changed to
@Persisted var linked_city: CityClass!
Describe the bug
I received this notice from MongoDB Realm Studio 11.1.1 when clicking on a class and am not sure what it means or what to do about it. I cannot view any of the objects in that class
Converting circular structure to JSON → starting at object with constructor ‘Object’ | property ‘embedded_dog_list’ → object with constructor ‘Array’ | index 0 → object with constructor ‘Object’ — property ‘parent_object’ closes the circle
To Reproduce
Here's the object structure. Note this does NOT occur on a freshly minted Realm file with no data. It only occurs after data is written.
There’s a parent Person object with embedded Dog objects (as a List), and then a City class which points back to the embedded dog list.
The idea here is the Persons have dogs. At the same time I want to know a person via the dog in a city. e.g. I can pull up a city, and get a list of dogs in that city, and also, through the parent_object field, know their person. (There are different types of owners, Person being one of them, which is why I used AnyRealmValue)
When loading a Person in code and printing it to console, everything looks normal and all values are as expected
Expected behavior
Show the objects of the class when clicking on the class?
Versions:
The text was updated successfully, but these errors were encountered: