[SERVER-39694] Implement $regexMatch as syntactic sugar on top of $regexFind Created: 20/Feb/19 Updated: 29/Oct/23 Resolved: 20/Mar/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | 4.1.9 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Ian Boros | Assignee: | Arun Banala |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Sprint: | Query 2019-03-25 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
$regexMatch (or whatever we decide to call it) will evaluate to a boolean indicating whether any part of the provided string matches the regex. |
| Comments |
| Comment by Githook User [ 20/Mar/19 ] |
|
Author: {'email': 'arun.banala@mongodb.com', 'name': 'Arun Banala', 'username': 'banarun'}Message: |
| Comment by Githook User [ 20/Mar/19 ] |
|
Author: {'email': 'arun.banala@mongodb.com', 'name': 'Arun Banala', 'username': 'banarun'}Message: |
| Comment by Asya Kamsky [ 12/Mar/19 ] |
|
david.storch yes I think that would be fine - since it's a new expression, it's not backwards breaking. |
| Comment by David Storch [ 12/Mar/19 ] |
|
asya, do you mean it seems ok for $regexMatch to throw a query-fatal error if the input type is not a string? That would be the easiest for us to implement, since it preserves the property that $regexMatch is syntactic sugar. |
| Comment by Asya Kamsky [ 08/Mar/19 ] |
|
That seems ok to me.
|
| Comment by Ian Boros [ 06/Mar/19 ] |
|
asya: arun.banala and I were talking over slack and a point came up about whether or not $regexMatch should error if the input value given is not type string. For $regexFind and $regexFindAll we've agreed to error in that situation, but for $regexMatch, we could see an argument for returning 'false'. i.e. $regexMatch will return true if the input type is string and it matches the regex, and false otherwise. What do you think? |