Creating custom finders
With Spring Data repositories, we are able to create queries to suit any situation. Earlier in this chapter, we saw findByName
, which merely queries based on the domain object's name
attribute.
The following table shows a more comprehensive collection of finders we can write with Spring Data MongoDB. To illustrate the breadth of these keywords, it presumes a domain model bigger than the Image
class we defined earlier:
Finder Method | Description |
| Query based on |
| Query based on |
| Query based on |
| Query based on |
| Query by |
| Query by |