How can I achieve this operation in spring data mongodb?
$group: {
"_id": {orderDate: {"$substr": ["$localDate",0,params.getDateType]},storeId: "$storeId"},
"date": {"$last": {"$substr": ["$localDate",0,params.getDateType]}
},
So far I have tried this.
GroupOperation groupOperation = Aggregation.group(String.valueOf(new BasicDBObject("orderDate",
StringOperators.Substr.valueOf("localDate").substring(0,dateType))))
.last(String.valueOf(new BasicDBObject("orderDate",
StringOperators.Substr.valueOf("localDate").substring(0,dateType)))).as("date")
Thanks in Advance.