datascript icon indicating copy to clipboard operation
datascript copied to clipboard

Does it possible to export/dump all db data as JSON?

Open mogadanez opened this issue 9 years ago • 3 comments

mogadanez avatar Dec 12 '16 17:12 mogadanez

Yes

tonsky avatar Dec 13 '16 15:12 tonsky

Sorry I forgot about that issue. Yes it’s totally possible. Consider

(js/JSON.stringify
  (into-array 
    (for [d (d/datoms db :eavt)]
      #js [(:e d) (name (:a d)) (:v d)])))

tonsky avatar Apr 09 '17 17:04 tonsky

Is this possible through the JS API? I see the datoms() function is exposed, but I'm still getting a function returned from that rather than data... it'd be great if I could just get an array of arrays ([[e, a, v, t, a-r], ...]).

whitecoop avatar Nov 15 '17 23:11 whitecoop