Let's say I have some documents in MongoDB with a version property(semver version), for example something like { ..., version: { major: 1, minor: 2, patch: 13 } }, or { ..., version: "1.2.13" }, i haven't decided yet which format i will be using.
I need to find the document with the highest version.
For example, if collection has two documents with {..., version: "0.10.0"} and {..., version: "1.0.0"} then i would like to get document with version = "1.0.0"
I'm using Spring Data MongoDB, so ideally i would like to find some solution by using Criteria API