Skip to content

Don't call filterQuery twice #455

Description

@DaddyWarbucks

The following code calls filterQuery just to get the pagination. It then calls paramsToAdapter which calls filterQuery again.

const { paginate } = this.filterQuery(params)

Instead, that line should just use this.options.paginate. This may seem like a micro-optimization, but I am extending the filterQuery method in a way that may traverse/clone the query multiple times, even stuff like id: { $in: [...many ids] } will cause many loops/clones.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions