As posted in another comment that's basically what https://github.com/sirixdb/sirix supports along with easily reconstructing former revisions of a JSON document (or any node therein), sophisticated secondary (also versioned) indexes, querying with JSONiq and optimizations at query compile time as for joins and aggregates....
In our case we opted for three types of secondary user-defined indexes (besides the main document trie index to find unique, stable nodes by their 64bit ID), namely
1. field indexes
2. path indexes
3. content-and-structure indexes which index paths and their typed values
Furthermore a path summary keeps track of all distinct paths in the JSON resource.
In our case we opted for three types of secondary user-defined indexes (besides the main document trie index to find unique, stable nodes by their 64bit ID), namely
1. field indexes
2. path indexes
3. content-and-structure indexes which index paths and their typed values
Furthermore a path summary keeps track of all distinct paths in the JSON resource.