如何在 spring boot 中编写以下 mongodb 查询?

How can I write the following mongodb query in springboot?

如何使用 Spring 数据 MongoDB 编写以下查询?

db.collection.find().sort({$natural: -1}).limit(5)

此查询从集合中查找最近的 5 个文档。

使用 Spring 数据 MongoDB 存储库或模板中的 find 方法以及以下 Query

new Query().with(Sort.by(Direction.DESC, "$natural")).limit(5);