I have a MongoDB collection containing User objects with two fields: Firstname and Lastname. I need a query that takes only one string (representing the user fullname) for a findLike research.
The problem is the same of this question but I do not know how translate that query for a MongoDB Repository in Spring Data using MongoTemplate or @Query annotation
EDIT:
Using project operator i have to specify all fields I want include in the stages. A better solution maybe could be use AddFields
operator:
A similar question I found is that:
https://stackoverflow.com/a/40812293/6545142
How can I use the $AddFields
operator with MongoTemplate?