这是indexloc提供的服务,不要输入任何密码
Skip to content

support more query operators in native query pipeline type inference #121

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

Merged

Conversation

hallettj
Copy link
Collaborator

This is work an an in-progress feature that is gated behind a feature flag, native-query-subcommand

When generating configurations for native queries it is necessary to analyze operators in $match stages in aggregation pipelines to infer types for any parameters that appear in operator arguments.

This PR adds the logic to process these operators:

  • $and | $or | $nor
  • $not
  • $elemMatch
  • $eq | $ne | $gt | $lt | $gte | $lte
  • $in | $nin
  • $exists
  • $type
  • $mod
  • $regex
  • $all
  • $size

The full set of available operators is given here: https://www.mongodb.com/docs/manual/reference/operator/query/

@hallettj hallettj changed the base branch from main to jessehallett/eng-1102-support-more-aggregation-expression-operators-when November 11, 2024 22:35
@hallettj hallettj self-assigned this Nov 11, 2024
match operator.as_ref() {
"$eq" => analyze_match_expression(
match operator.as_ref() {
"$and" | "$or" | "$nor" => {
Copy link
Contributor

Choose a reason for hiding this comment

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

So once again we hardcode every function we want to support? This does at least result in very concrete checking code.

Copy link
Contributor

@danieljharvey danieljharvey left a comment

Choose a reason for hiding this comment

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

Makes sense.

@hallettj hallettj force-pushed the jessehallett/eng-1102-support-more-aggregation-expression-operators-when branch from 4094237 to 0b52183 Compare November 19, 2024 17:26
Base automatically changed from jessehallett/eng-1102-support-more-aggregation-expression-operators-when to main November 19, 2024 19:26
@hallettj hallettj force-pushed the jessehallett/eng-1248-type-inference-for-more-match-operators branch from e9ee52a to 9ed82c6 Compare November 19, 2024 19:58
@hallettj hallettj merged commit 5408060 into main Nov 19, 2024
1 check passed
@hallettj hallettj deleted the jessehallett/eng-1248-type-inference-for-more-match-operators branch November 19, 2024 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants