Skip to content

$where operator throws process is not defined in browser environments #272

@geeee

Description

@geeee

Hello,

I’m trying to test for equality between two properties in an object using the $where operator with a string, like this:

{ "$where": "this.var1 === this.var2" }

However, when running this in a browser environment, it fails with the Uncaught ReferenceError: process is not defined exception, since it's checking for !process.env.CSP_ENABLED internally. And process is undefined in browser environments.

I'm wondering of what's the expected behavior for $where in cases like this? Do you think it's necessary to restrict it due to potential security concerns?

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