Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

Conversation

@rueckstiess
Copy link
Contributor

This is now supported as of MongoDB 4.0.7.
https://docs.mongodb.com/manual/reference/operator/query/not/index.html#not-and-regular-expressions

To support this change, we needed to add a special rule that allows $not to accept a ejson_regex right-hand side value.

To test, you can also visit https://pegjs.org/online and copy the ./src/grammar.pegjs content in the left-hand box, then write some queries in the right-hand side box, e.g.

{"foo": {"$not": {"$regex": "^Th", "$options": "g"}}}

I've also added tests for several cases with $regex.

Copy link
Contributor

@matt-d-rat matt-d-rat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@rueckstiess rueckstiess merged commit 0b8bf53 into master Aug 14, 2019
@rueckstiess rueckstiess deleted the feat/charts-2701-support-not-regex branch August 14, 2019 01:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants