Uploaded image for project: 'Realm Studio'
  1. Realm Studio
  2. RSTUDIO-485

Converting circular structure to JSON → starting at object with constructor

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      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

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: