Pagination total count behavior across different service adapters
0 reputation · 08 Jun 2024, 16:22 UTC
FeathersJS provides a standardized pagination interface for the find method using page and perPage parameters. However, the mechanism for calculating the total metadata field varies depending on the underlying adapter used by the service.
While the memory adapter handles the total count inherently, other database adapters may require a separate count query to populate this value. In low-traffic environments where resource optimization is a priority, executing an additional count query for every paginated request can introduce unnecessary overhead.
What is the documented strategy for ensuring consistent total field behavior when switching between adapters? Is there a configuration to disable the automatic count query to reduce database load?