Database

[{"title":"test1",sort:1,parent:1},{"title":"test2",sort:7,parent:1},{"title":"test3",sort:5,parent:1},{"title":"test4",sort:1,parent:2},{"title":"test5",sort:7,parent:2},{"title":"test6",sort:5,parent:2}]

Query

db.collection.aggregate([{/** match on the parent you want*/$match:{"parent":1}},{/** sort the docs under that parent*/$sort:{"sort":1}},{/** create a group for that one parent which is* currently all docs due to first $match stage*/$group:{_id:null,docs:{/** docs will be already sorted in this array*/$push:"$$ROOT"}}},{/** set each doc `sort` field to the value it should be* based on its index in docs*/$set:{docs:{$map:{input:"$docs",in:{$mergeObjects:["$$this",{"sort":{$add:[1,{$multiply:[{$indexOfArray:["$docs","$$this"]},10]}]}}]}}}}},{$unwind:"$docs"},{$replaceRoot:{newRoot:"$docs"}}])

Result