I want to implement pagination with scroll. My goal is to get a slice of data when scroll event is triggered.
My document "Foo" structure is relatively complex with a lot of nested objects. But I need to show only two fields from these documents.
I have two questions:
for example:
@Query(value="{ path : ?0}", fields="{ path : 0 }")
List<Foo> findByPath(String path);
If yes, How can I get a slice of documents with specific fields using "Pagebale"
Slice<Foo> findSliceBy(Pageable pageable);
When specifying the fields the performance is enhanced.
Just annotating the findSliceBy method with @Query will do the job
@Query(fields="{path:1, name:1}")
Slice<Foo> findSliceBy(Pageable pageable);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.