-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
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
mango: add $beginsWith operator #4810
Merged
Merged
Commits on Oct 26, 2023
-
mango: add $beginsWith operator
Adds a `$beginsWith` operator to selectors, with json and text index support. This is a compliment / precursor to optimising `$regex` support as proposed in #4776. For `json` indexes, a $beginsWith operator translates into a key range query, as is common practice for _view queries. For example, to find all rows with a key beginning with "W", we can use a range `start_key="W", end_key="W\ufff0"`. Given Mango uses compound keys, this is slightly more complex in practice, but the idea is the same. As with other range operators (`$gt`, `$gte`, etc), `$beginsWith` can be used in combination with equality operators and result sorting but must result in a contiguous key range. That is, a range of `start_key=[10, "W"], end_key=[10, "W\ufff0", {}]` would be valid, but `start_key=["W", 10], end_key=["W\ufff0", 10, {}]` would not, because the second element of the key may result in a non-contiguous range. For text indexes, `$beginsWith` translates to a Lucene query on the specified field of `W*`. If a non-string operand is provided to `$beginsWith`, the request will fail with a 400 / `invalid_operator` error.
Configuration menu - View commit details
-
Copy full SHA for 1b05e0c - Browse repository at this point
Copy the full SHA 1b05e0cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 80378af - Browse repository at this point
Copy the full SHA 80378afView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0292f50 - Browse repository at this point
Copy the full SHA 0292f50View commit details -
Configuration menu - View commit details
-
Copy full SHA for de1f012 - Browse repository at this point
Copy the full SHA de1f012View commit details -
Configuration menu - View commit details
-
Copy full SHA for bf2de99 - Browse repository at this point
Copy the full SHA bf2de99View commit details -
Configuration menu - View commit details
-
Copy full SHA for c700f12 - Browse repository at this point
Copy the full SHA c700f12View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a94e00 - Browse repository at this point
Copy the full SHA 3a94e00View commit details -
Configuration menu - View commit details
-
Copy full SHA for b07e067 - Browse repository at this point
Copy the full SHA b07e067View commit details -
Configuration menu - View commit details
-
Copy full SHA for a5af777 - Browse repository at this point
Copy the full SHA a5af777View commit details
Commits on Oct 30, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 8e29e60 - Browse repository at this point
Copy the full SHA 8e29e60View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c88819 - Browse repository at this point
Copy the full SHA 5c88819View commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.