Convert django to nextjs mongoose

I need convert this django code to mongoose nextjs

BonusRefill.objects.values('user').order_by('user').annotate(total_price=Sum('amount')).order_by('total_price').last()

i tried this but not working

BonusRefill.find().sort('user')
Back to Top