i have already created a project in spring boot and i can retrieve data from my mongodb database using mongo repository.
i want to write a query in my spring boot app that allows me to get distinct values of an attribute for a given value of another attribute.
Example
tag1 | tag2 | tag3
mod | test | v1
mod1 | test1 | v2
mod1 | test1 | v3
mod1 | test1 | v4
expected: when i call method findbyTag1 ( String tag1) using value mod1 for tag1 variable i want to get distinct values of tag2. In this case the result would be test1.
is there any solution?