Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve JSON exporting #1453

Open
kraenhansen opened this issue Sep 20, 2021 · 0 comments
Open

Improve JSON exporting #1453

kraenhansen opened this issue Sep 20, 2021 · 0 comments

Comments

@kraenhansen
Copy link
Member

kraenhansen commented Sep 20, 2021

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: #15 (since the age of times).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant