malteseduck / spring-data-marklogic

An implementation of the Spring Data interfaces for the MarkLogic NoSQL database
Apache License 2.0
7 stars 9 forks source link

By default save JSON with type root #41

Open malteseduck opened 6 years ago

malteseduck commented 6 years ago

In order to "simplify" the JSON saved in the database and make it more compatible with other systems/tools/etc. we opted to store the JSON without a type root. In general this works well, but for value queries at the "root" the only way to correctly match is with a range index.

A container query would work if there was a root node there, and removes some of the "free-floating" value matches. Path range indexes could then be specified at a type level, and more general indexes could be created as element range indexes.

Add a type persistence strategy of "ROOT" that would tell the converter to include the root when it serializes.