Database

[{"_id":{"$oid":"6122ca5df5ee9d5974c6e886"},"Name":"ccc","cusId":1},{"_id":{"$oid":"6122ca5df5ee9d5974c6e887"},"Name":"ddd","cusId":4},{"_id":{"$oid":"6122ca5df5ee9d5974c6e888"},"Name":"eee","cusId":5},{"_id":{"$oid":"612bc88610921de4b5a6bd0d"},"Name":"last","cusId":1},{"_id":{"$oid":"61571141c8cdee23c9a46a3a"},"Name":"lastRecord","cusId":1}]

Query

db.collection.aggregate([{"$lookup":{"from":"collection",let:{cid:"$cusId"},pipeline:[{$match:{$expr:{$eq:["$$cid","$cusId"]}}},{"$group":{_id:"$cusId",created:{$max:{$toDate:"$_id"}}}}],"as":"latestLookup"}},{$unwind:{path:"$latestLookup",preserveNullAndEmptyArrays:true}},{$match:{$expr:{$ne:["$latestLookup.created",{$toDate:"$_id"}]}}},{$project:{Name:1,cusId:1}},{$out:"tempColl"}])

Result