Database

[{_id:"a",points:1},{_id:"b",points:2},{_id:"c",points:7},{_id:"d",points:6},{_id:"e",points:38},{_id:"f",points:19},{_id:"g",points:254},{_id:"h",points:934},{_id:"i",points:45},{_id:"j",points:12},{_id:"k",points:8},{_id:"l",points:25435},{_id:"m",points:24}]

Query

db.collection.aggregate([{$setWindowFields:{sortBy:{points:-1},output:{neighbors:{$push:"$$ROOT",window:{documents:[-3,3]}},index:{$sum:1,window:{documents:["unbounded","current"]}}}}},{$match:{_id:"k"}},{$project:{neighbors:{$reduce:{input:"$neighbors",initialValue:[],in:{$concatArrays:["$$value",[{$mergeObjects:["$$this",{index:{$add:[{$subtract:[{$size:"$$value"},4]},"$index"]}}]}]]}}},_id:0}},{$unwind:"$neighbors"},{$replaceRoot:{newRoot:"$neighbors"}}])

Result