-
-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
Description
Ported from: querydsl/querydsl#3916
Observed vs. expected behavior
I have a Collection in Mongodb with 2 fields, 'totalStock' and 'minStock',
I want to get all data where totalStock <= minStock by
QProduct product = QProduct.product;
BooleanBuilder booleanBuilder = new BooleanBuilder();
booleanBuilder.and(product.totalStock.loe(product.minStock));
productMongoRepository.findAll(booleanBuilder, pageable)
But the results returned empty, which should have expected data when checking through my Mongodb data explorer.
Below is the productMongoRepository class that extends MongoRepository and QueryDSLPredicateExecutor:
public interface ProductMongoRepository extends MongoRepository<Product,String>, QuerydslPredicateExecutor {
}
Both values of the POJO are in 'double' values:
public class Product {
...
private double totalStock;
private double reservedStock;
private double minStock;
}
Environment
localhost, mongodb
Querydsl version: 5.1.0
Querydsl module: querydsl-apt, querydsl-mongodb
Database: MongoDB
JDK: 21
Metadata
Metadata
Assignees
Labels
No labels