Skip to content

do not use $ne operator #50

@gabzim

Description

@gabzim

In large collections, the $ne operator is very inefficient and can make queries slow. (https://docs.mongodb.com/manual/reference/operator/query/ne/ last paragraph).

I recently had to investigate performance troubles we're having in one of our largest collections and it's due to the use of this plugin. What I'd suggest is maybe always keeping deleted as false and then doing {$eq: false} to retrieve active documents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions