Skip to content
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

feat(query-generation): add support for $sort INTELLIJ-196 #131

Merged
merged 1 commit into from
Jan 24, 2025

Conversation

kmruiz
Copy link
Contributor

@kmruiz kmruiz commented Jan 23, 2025

Description

Checklist

Open Questions

Sorry, something went wrong.

@github-actions github-actions bot added the feat label Jan 23, 2025
node.component<HasFieldReference<S>>()
?: return registerVariable("queryField", ref.type.baseType)

resolveFieldReference(fieldRef)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this because I realised that we weren't supporting Computed values. This is something that we will need to improve whenever we support Computed values that are more than just a field reference.

Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to be interesting because now we can finally see if the root bsonType will be helpful in generating these queries or not. Right now we only take one HasFieldReference component but there could be more :D

Copy link
Contributor

Choose a reason for hiding this comment

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

Should we leave a todo with a ticket or were you planning to tackle this as part of group?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAIK for now we are only going to support field names as references, no arbitrary expressions, so I think this is kinda of enough for our use cases. I was thinking that we could rework this method in the future whenever we support more types of expressions. I can create a ticket for this, I think it's good to track it.

Copy link

Coverage Report

Overall Project 79.97% -0.18%
Files changed 57.41% 🚫

File Coverage
Sort.kt 94.12% -5.88%
Aggregate.kt 90.08%
References.kt 49.55% -29.02% 🚫

Copy link

🤖 Benchmark Comparison for chore: add support for , and fix issues with computed values

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,615,684,047.02 ops/s 2,670,281,465.47 ops/s 2.09%

@kmruiz kmruiz requested a review from himanshusinghs January 23, 2025 16:55
node.component<HasFieldReference<S>>()
?: return registerVariable("queryField", ref.type.baseType)

resolveFieldReference(fieldRef)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to be interesting because now we can finally see if the root bsonType will be helpful in generating these queries or not. Right now we only take one HasFieldReference component but there could be more :D

node.component<HasFieldReference<S>>()
?: return registerVariable("queryField", ref.type.baseType)

resolveFieldReference(fieldRef)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we leave a todo with a ticket or were you planning to tackle this as part of group?

@kmruiz kmruiz merged commit 4433d1b into main Jan 24, 2025
12 checks passed
@kmruiz kmruiz deleted the feat/INTELLIJ-196 branch January 24, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants