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: support generating shell syntax for $group INTELLIJ-197 #134

Merged
merged 4 commits into from
Jan 30, 2025

Conversation

himanshusinghs
Copy link
Contributor

@himanshusinghs himanshusinghs commented Jan 30, 2025

Description

This PR adds support for generating shell syntax for $group stage and the supported accumulators.

Checklist

Open Questions

@github-actions github-actions bot added the feat label Jan 30, 2025
@github-actions github-actions bot added feat and removed feat labels Jan 30, 2025
@github-actions github-actions bot added feat and removed feat labels Jan 30, 2025
Copy link

github-actions bot commented Jan 30, 2025

Coverage Report

Overall Project 80.81% -0.22%
Files changed 86.29%

File Coverage
Group.kt 94.78% -5.22%
Unwind.kt 94.64%
Sort.kt 92.73%
Update.kt 91.79%
Aggregate.kt 90.46%
Find.kt 83.18%
References.kt 63.51% -19.78% 🚫
Context.kt 61.88%

@github-actions github-actions bot added feat and removed feat labels Jan 30, 2025
Comment on lines +53 to +58
emitObjectKey(
resolveFieldReference(
fieldRef = field,
fieldUsedAsValue = false,
)
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kmruiz I adopted this approach to make MongoshBackend understand when to prefix the field name with a $ and when not to. The idea is if a field reference is used in the value place then it is supposed to be true and the emitted field will be prefixed with $ otherwise not.

Copy link

🤖 Benchmark Comparison for feat: support generating shell syntax for $group

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,606,573,293.49 ops/s 2,627,754,671.98 ops/s 0.81%

Copy link

🤖 Benchmark Comparison for chore: add CHANGELOG entry

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,606,573,293.49 ops/s 2,670,051,607.07 ops/s 2.44%

Copy link

🤖 Benchmark Comparison for chore: rebased fixture file with that on main

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,606,573,293.49 ops/s 2,658,418,223.59 ops/s 1.99%

Copy link

🤖 Benchmark Comparison for chore: updated docs

Benchmark Previous Current Change
com.mongodb.jbplugin.jmh.SampleBenchmark.init 2,606,573,293.49 ops/s 2,596,057,268.65 ops/s -0.40%

@himanshusinghs himanshusinghs merged commit aed046f into main Jan 30, 2025
12 checks passed
@himanshusinghs himanshusinghs deleted the INTELLIJ-197-generate-shell-syntax-group-stage branch January 30, 2025 11:31
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.

2 participants