Eliminate duplicates in MongoDB with a specific sort
问题 I have a database composed by entries which correspond to work contracts. In the MongoDB database I have aggregated by specific worker, then the database - in a simplified version - looks like something like that. { "_id" : ObjectId("5ea995662a40c63b14266071"), "worker" : "1070", "employer" : "2116096", "start" : ISODate("2018-01-11T01:00:00.000+01:00"), "ord_id" : 0 }, { "_id" : ObjectId("5ea995662a40c63b14266071"), "worker" : "1070", "employer" : "2116096", "start" : ISODate("2018-01-11T01