below is my code -
MatchOperation match_Status_Count = new MatchOperation(
Criteria.where("date1").gte("2019-3-25T17:34:24.734Z").andOperator(
Criteria.where("date1").lte("2019-11-25T17:34:24.734Z")
));
GroupOperation group_Status_Count = Aggregation.group("Status").count().as("Statuscount");
Aggregation aggregate_Status_Count = Aggregation
.newAggregation(match_Status_Count, group_Status_Count)
.withOptions(new AggregationOptions(false, false,
new BasicDBObject(new Document().append("batchSize", 100000000000L))));
;
AggregationResults<ARStructData> orderAggregate_Status_Count = mongoTemplate
.aggregate(aggregate_Status_Count, D_AR_COLLECTION_NAME, ARStructData.class);
Since the date is stored as string ,hence it returning according to the string gte and lte. Appreciated if someone give me solution for it.