i have to find the max value in spring boot with mongoDB. Here is my sample code which i have tried and successfully executed in mongoDB console
db.ecle_audit_transaction.aggregate(
[
{
$group:
{
_id: "$rootId",
logMessageType: { $max: "$logMessageType" }
}
}
]
)
could you please help me how to write this query in spring bootmongoTemplate