Fork me on GitHub
#clojure-spec
<
2021-06-10
>
mathias_dw17:06:15

hi, i have a big collection of specced data that went into mongodb and lost all the namespace info. I suppose I can transform it all by recursively using the information in (s/describe) of the top-level (big) data structure. But before doing that, I thought I'd ask if something like that already exists. Anything similar? Just to complicate it a little: there are also plenty of non-namespaced and non-specced keys that got in there as well. They shouldnt be given a namespace.

delaguardo05:06:58

Mongodb is storing data as json. So you probably need to have some sort of convention how to encode qualified keywords to/from json

mathias_dw14:06:02

Thanks for you reply! Yeah, i realize that now, but the problem is that a lot of production data was stored without the namespace info before I noticed, and it's not something i can re-do. Anyway, the approach with using s/describe also doesnt work, because of things like merge etc. So guess I'll have to write custom code for the exact data structure.