Skip to content

Escaping of - not compatible with MongoDB #22

Closed
@marwej

Description

@marwej

I do a MongoDB query like:

const query = {
    email: new RegExp('^' + escapeString(email) + '$', 'i'), // Case insensitive
};

In 3.0.0, this is not working with emails containing -. Do you know how I could write this using the new way to escape -?

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