1

I have the document User with the following attributes (name, username, password, application)

I want to search all the users that are from the same application as one of the users.

Example: First I find what application a user belongs (querying by Email). Then, I use the value to query the users that belong to the returned application.

I can achieve that in mongoDB with the query:

db.user.find(db.user.findOne( { email: "root@root.com" }, { application: 1, _id: 0 } ))

However, I cannot use it in Spring repositories.

Mauro Cruz
  • 105
  • 1
  • 1
  • 8

0 Answers0