-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
status: ideal-for-contributionAn issue that a contributor can help us withAn issue that a contributor can help us withtype: enhancementA general enhancementA general enhancement
Description
The documentation for repository query keywords (link) mentions support for the IsEmpty keyword, however, it fails with "Unsupported keyword" when used.
Steps to reproduce
0) spring initializr:
- Maven & Kotlin on Java 17
- Spring Boot 3.2.1
- Dependencies: MongoDB Reactive
- Inside file with
@SpringBootApplication
, add the code below - Start the app (no need for a running Mongo instance to get the exception)
interface CustomRepository : ReactiveMongoRepository<CustomData, String> {
fun findByIdIsEmpty(id: String): Mono<Boolean>
}
data class CustomData(val id: String)
@Component
class Demo(val customRepository: CustomRepository) {
@Bean
fun accessRepo() {
customRepository.findByIdIsEmpty("non-existent").block()
}
}
Result
Error creating bean 'accessRepo', caused by org.springframework.beans.BeanInstantiationException
: Failed to instantiate [void]: Factory method 'accessRepo' threw exception with message: Unsupported keyword
The exception is thrown inside org.springframework.data.mongodb.repository.query.from
(line number 254), because the switch-statement above (line 168) has no case for IS_EMPTY
, even though the keyword is defined in org.springframework.data.repository.query.parser.Type
.
Metadata
Metadata
Assignees
Labels
status: ideal-for-contributionAn issue that a contributor can help us withAn issue that a contributor can help us withtype: enhancementA general enhancementA general enhancement