Skip to content

Don't call filterQuery twice #455

@DaddyWarbucks

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.

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