DOC-934 | ANY/ALL/NONE/AT LEAST support for LIKE operator#1043
DOC-934 | ANY/ALL/NONE/AT LEAST support for LIKE operator#1043nicos-arango wants to merge 2 commits into
Conversation
|
Deploy Preview Available Via |
|
Warning Review limit reached
More reviews will be available in 56 minutes and 14 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| is prefixed with an `ALL`, `ANY`, or `NONE` keyword. This changes the operator's | ||
| behavior to compare the individual array elements of the left-hand argument to the | ||
| right-hand argument. Depending on the quantifying keyword, all, any, or none of |
There was a problem hiding this comment.
The AT LEAST operator isn't taken into account, we should fix this (also for other versions that support it)
| ["foo", "bar"] ANY == "foo" // true | ||
| ["foo", "bar"] ALL LIKE "%o%" // false | ||
| ["foo", "bar"] ANY LIKE "b%" // true | ||
| ["foo", "bar"] NONE LIKE "%a%" // false |
There was a problem hiding this comment.
| ["foo", "bar"] NONE LIKE "%a%" // false | |
| ["foo", "bar"] NONE LIKE "_a_" // false |
| ["foo", "bar"] ALL LIKE "%o%" // false | ||
| ["foo", "bar"] ANY LIKE "b%" // true | ||
| ["foo", "bar"] NONE LIKE "%a%" // false | ||
| ["foo", "bar"] ANY NOT LIKE "f%" // true |
There was a problem hiding this comment.
| ["foo", "bar"] ANY NOT LIKE "f%" // true | |
| ["foo", "bar"] ANY NOT LIKE "f__" // true |
|
|
||
| [ 1, 2, 3 ] AT LEAST (2) IN [ 2, 3, 4 ] // true | ||
| ["foo", "bar"] AT LEAST (1+1) == "foo" // false | ||
| ["foo", "bar"] AT LEAST (1) LIKE "b%" // true |
There was a problem hiding this comment.
AT LEAST 1 doesn't make much sense, you could use ANY for that.
| ["foo", "bar"] AT LEAST (1) LIKE "b%" // true | |
| ["foo", "bar"] AT LEAST (3) LIKE "_oo" // false |
| ``` | ||
|
|
||
| The `LIKE` and `NOT LIKE` array variants only execute if the left-hand operand | ||
| is an array and the right-hand operand is a string. The pattern matching follows |
There was a problem hiding this comment.
This seems incorrect. The expression is evaluated regardless because it has to "execute" in a sense to produce a resulting value, and it seems to implicitly cast non-string values to string.
For example RETURN [{a:1},2] ANY LIKE "{\"%\":1}" is true and RETURN [1,2, 34] AT LEAST (2) LIKE "_" as well.
| The `LIKE` and `NOT LIKE` array variants only execute if the left-hand operand | ||
| is an array and the right-hand operand is a string. The pattern matching follows | ||
| the same rules as the scalar [`LIKE` operator](#comparison-operators) including the | ||
| supported wildcards and case-sensitivity. |
There was a problem hiding this comment.
Not sure if I follow, when using the LIKE operator one cannot make use of the case-insensitivity option that the LIKE() function offers
|
|
||
| ```aql | ||
| ["foo", "bar"] ANY LIKE "b%" // true | ||
| ["foo", "bar"] AT LEAST (2) LIKE "b%" // false |
There was a problem hiding this comment.
| ["foo", "bar"] AT LEAST (2) LIKE "b%" // false | |
| ["foo", "bar"] AT LEAST (2) LIKE "_oo" // false |
| ["foo", "bar"] AT LEAST (2) LIKE "b%" // false | ||
| ``` | ||
|
|
||
| Previously, `LIKE` and `NOT LIKE` were among the few operators that could not be |
There was a problem hiding this comment.
| Previously, `LIKE` and `NOT LIKE` were among the few operators that could not be | |
| Previously, `LIKE` and `NOT LIKE` were among the few comparison operators that could not be |
| combined with the array comparison operators. The regular expression operators | ||
| `=~` and `!~` remain unsupported as array variants. |
There was a problem hiding this comment.
Might change: https://arangodb.atlassian.net/browse/COR-679
But fine to merge the PR like this, let's just not forget to update it the newly added text if necessary later on.
Description
Upstream PRs