[SERVER-13779] Allow $not to be applied to $regex (currently only /regex/ syntax is allowed) Created: 28/Apr/14 Updated: 19/Mar/19 Resolved: 31/Jan/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.4.10, 2.6.0 |
| Fix Version/s: | 4.0.7, 4.1.8 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Norberto Fernando Rocha Leite (Inactive) | Assignee: | James Wahlin |
| Resolution: | Done | Votes: | 8 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||
| Backport Requested: |
v4.0
|
||||||||||||||||||||||||||||||||||||
| Sprint: | Query 2019-02-11 | ||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||
| Description |
|
Executing the following queries I was expecting the same result but apparently they are dealt differently: 2 scenarios
Is this the expected behaviour ? and if so why ? Looking deeper in the code I can also see the following comment:
and looking int the jstests it makes even less sense: jstests/core/not2.js
|
| Comments |
| Comment by Githook User [ 19/Feb/19 ] |
|
Author: {'name': 'James Wahlin', 'email': 'james@mongodb.com', 'username': 'jameswahlin'}Message: (cherry picked from commit 4677879eb75934ee3cd76c9e9807f6892ac17400)
(cherry picked from commit a2c0f15d6dc9fcda389b18b54287c4fcb5be44cd) |
| Comment by Githook User [ 31/Jan/19 ] |
|
Author: {'name': 'James Wahlin', 'email': 'james@mongodb.com', 'username': 'jameswahlin'}Message: |
| Comment by Jason R. Coombs [ 20/Mar/17 ] |
|
This issue seems pretty serious to me as the $regex is the only syntax allowed in the Extended JSON Syntax (strict) as required by tools like Compass, mongodump, and REST interfaces (including third-party tools like Mongs). Lack of support for this feature is comparable to a SQL database not having support for "NOT LIKE" in queries. |
| Comment by J. Cardina [ 01/Aug/14 ] |
|
Came here to ask the same question, why on earth is this not supported? It's required because you can't use the /something/ format with other operators you have to use the $regex format so there is very limited functionality as a result of this when you want to do anything significantly complex. |