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

Improve JSON exporting

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None

      Is your feature request related to a problem? Please describe.

      The current solution for exporting to JSON uses the JSON.stringify with a fallback to the Realm.JsonSerializationReplacer which doesn't work well for highly branching data. This results in very large strings of JSON data, ultimately throwning errors such as "failed to export invalid string length".

      Describe the solution you'd like

      We could choose a single file, which is nice because users don't need to jougle multiple interdependent .json files. It doesn't however play nicely with the tools available to import data into a MongoDB server (mongodbimport and MongoDB Compass).

      In order to facilitate a migration from the legacy Realm Cloud into MongoDB Atlas, we could implement exporting to a JSON format of multiple files (one per class). The format should ideally be new-line or "comma seperated" JSON files, making them compatible with the current tools available for importing (see https://docs.mongodb.com/compass/current/import-export/).

      We could provide an option to generate _id values for the to-be documents and use these for relationships between objects.

      Describe alternatives you've considered

      We could invest in implementing a CSV exporter instead.

      Additional context

      We're also tracking this issue: https://github.com/realm/realm-studio/issues/15 (since the age of times).

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

              Created:
              Updated: