Mongodb Spring Data Mongo-带来分页数据,而无需嵌入文档

Mongodb Spring Data Mongo-带来分页数据,而无需嵌入文档,mongodb,spring-data-mongodb,Mongodb,Spring Data Mongodb,我浏览了很多链接,比如:。我使用的是Spring Boot v2.2.2.RELEASE+Spring Data Mongo示例 我想让所有员工都有分页的数据,但我不想把部门带来 我需要在页面findAll(Pageable-Pageable)中更改的内容 我可以使用下面的springdatamongo查询来完成这项工作 @Query(value = "{}", fields = "{'departments': 0}") Page<Employee> findAll(Pageabl

我浏览了很多链接,比如:。我使用的是Spring Boot v2.2.2.RELEASE+Spring Data Mongo示例

我想让所有员工都有分页的数据,但我不想把部门带来

我需要在
页面findAll(Pageable-Pageable)中更改的内容


我可以使用下面的
springdatamongo
查询来完成这项工作

@Query(value = "{}", fields = "{'departments': 0}")
Page<Employee> findAll(Pageable pageable);
@Query(value=“{}”,fields=“{'departments':0}”)
页面findAll(可分页可分页);

我可以使用下面对
Spring Data Mongo的查询来完成它

@Query(value = "{}", fields = "{'departments': 0}")
Page<Employee> findAll(Pageable pageable);
@Query(value=“{}”,fields=“{'departments':0}”)
页面findAll(可分页可分页);