Spring boot 如何使用Spring Boot JPA查询方法关键字过滤MongoDB中的空字符串

Spring boot 如何使用Spring Boot JPA查询方法关键字过滤MongoDB中的空字符串,spring-boot,spring-boot-jpa,Spring Boot,Spring Boot Jpa,我正在尝试查找ID不是空字符串和非null的所有约会,但无法确定方法是什么 以下是我的存储库方法: findByAppointmentIdNotNullAndAppointmentIdNot(String condition); 内部服务器错误 org.springframework.data.mongodb.InvalidMongoDbApiUsageException: Due to limitations of the com.mongodb.BasicDocument, you can

我正在尝试查找ID不是空字符串和非null的所有约会,但无法确定方法是什么

以下是我的存储库方法:

findByAppointmentIdNotNullAndAppointmentIdNot(String condition);
内部服务器错误

org.springframework.data.mongodb.InvalidMongoDbApiUsageException: Due to limitations of the com.mongodb.BasicDocument, you can't add a second 'appointmentId' expression specified as 'appointmentId : Document{{$ne=}}'. Criteria already contains 'appointmentId : Document{{$ne=null}}'.

在这里使用NotNull和Not关键字,并传递空字符串作为条件,不幸的是结果仍然包含约会id为空字符串的约会。有什么帮助吗?

是否尝试将存储库方法替换为findByAppointmentIdNotNullAndNot(字符串条件);是否尝试将存储库方法替换为findByAppointmentIdNotNullAndNot(字符串条件);