Exporting current DB to JSON
Hey,
We want to export the current DB to a JSON file. This is used for small scale copy of the DB that includes a small number of users that can be used for unit tests.
This does not use any product (e.g. Neptune) but just plain Tinkerpop server/client.
I used to export it using Graphson:
graph.io(graphson()).writeGraph("data/defaultDB.json");
However, since there are some vertices that are too big (and by that I mean that they have a lot of edges), longer lines are trimmed with a ..
at the end, essentially breaking the JSON file. Even if you fix the formatting, there is still omitted information.
Is there a better way to do it for small-medium sized DBs with complicated vertices and edges?4 Replies
TinkerPop has an option to export the entire graph on close. I'm not 100% sure if using that will help. I posted the steps here somewhere the other day. I'll try to find them and copy paste here as well.
Thanks! I will try it today at work. Do you know if this circumvents the trimming issue when a vertex has too many edges and properties?
Regardless, I will test.
I'm not sure on the "trimming" I have not observed that. It is supposed to be the entire graph in a form that is re-loadable. The trimming I thought was only when you print the results to the screen.
Understood. Thanks. I was not able to check today, been in a ton of meetings. Hopefully tomorrow would be calmer in that regard 😅