I'm trying to do a convertion from String to Decimal128 in a @Query to perform a paging operation using the following snippet:
public interface ExpenseCollectionRepository extends ReactiveMongoRepository<ExpenseCollection, String> {
Mono<Boolean> existsByDescriptionAndDueDate(String description, LocalDate dueDate);
@Query("{'$or':" +
" [" +
"{'description': '?0'}," +
"{'value': '?#{#search.matches(\"-?\\\\d+(\\\\.\\\\d+)?\") ? T(org.bson.types.Decimal128).parse(#search) : T(org.bson.types.Decimal128).parse(\"0.0\")}}'}," +
"{'paymentDate': '?0'}," +
"{'dueDate': '?0'}," +
"{'type': '?0'}," +
"{'payed': '?0'}" +
"]" +
"}")
Flux<ExpenseCollection> findPage(@Param("search") String search, Pageable pageable);
}
What an I missing? Do I using Spel wrongly?