Skip to content

Pagination and filtering #2

Description

@ditschedev

It should be possible to filter and paginate data using query parameters.

  • filtering: use populate() function of mongoose.
  • pagination:
    • response should contain a _page property
      _page: {
          total: 200,
          pages: 20,
          page: 2,
          limit: 10,
          first: {
              page: 1,
              href: "http://api.example.dev/resource"
          },
          next: {
              page: 3,
              href: "http://api.example.dev/resource?page=3"
          },
          prev: {
              page: 1,
              href: "http://api.example.dev/resource"
          },
          last: {
              page: 20,
              href: "http://api.example.dev/resource?page=20"
          }
      }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions