您正在执行的操作是仅在键覆盖中使用
{$lte: toDate}丢失$gte运算符进行查询。您想要的是:
query.put("dateAdded", BasicDBObjectBuilder.start("$gte", fromDate).add("$lte", toDate).get());
您正在执行的操作是仅在键覆盖中使用
{$lte: toDate}丢失$gte运算符进行查询。您想要的是:
query.put("dateAdded", BasicDBObjectBuilder.start("$gte", fromDate).add("$lte", toDate).get());