We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The code inserts partial newline-sensitive matching into regex expressions when required. For example, this query:
{"name":{ "$regex":"forest"}}
correctly leads to:
record->>'name' ~ '(\?p)forest'
However, when more than one is present, only the first one escapes the question mark. For example, this query:
{"$or":[{"name":{ "$regex":"forest"}},{"entity.description":{ "$regex":"forest"}}]}
incorrectly leads to:
(record->>'name' ~ '(\?p)forest' OR record->'entity'->>'description' ~ '(?p)forest')
Here the latter (?p) should be (\?p). Without the escaped question-mark, Postgres interprets this as a replacement parameter.
(?p)
(\?p)
A workaround for this is to escape such instances manually after the convert:
where.replaceAll(/'\(\?([^\)]+)\)/g, "'(\\?$1)");
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The code inserts partial newline-sensitive matching into regex expressions when required. For example, this query:
correctly leads to:
However, when more than one is present, only the first one escapes the question mark. For example, this query:
incorrectly leads to:
Here the latter
(?p)
should be(\?p)
. Without the escaped question-mark, Postgres interprets this as a replacement parameter.A workaround for this is to escape such instances manually after the convert:
The text was updated successfully, but these errors were encountered: