-
Notifications
You must be signed in to change notification settings - Fork 1.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
Using aggregation parameters with @Aggregation #4697
Comments
Thank you for getting in touch. |
My bad, I did not notice the pipeline accepts multiple strings, thanks!
Thank you, that helped also, I got confused by the JavaDoc example: @Aggregation("{ '$group': { '_id' : '$lastname', names : { $addToSet : '$?0' } } }")
List<PersonAggregate> groupByLastnameAnd(String property); Maybe it is just me, but a simpler aggregation pipeline (not using the property, but actual values) in the JavaDoc might prevent someone in the future from doing the same mistake I did. Sorry for the noise and thank you for your time. |
thank you for the feedback, glad it works for you now - yeah, makes sense to revisit the documentation. |
I am trying to run the following MongoDB aggregation using Spring:
The query should find all documents in a time range and aggregate them using a specific time interval (the
?2
parameter).When I run this pipeline directly on Mongo using specific dates and mod parameter, everything works as expected. Example:
But, when I run this using Spring, I get the following exception:
I have tried wrapping the parameters, such as
'$?0'
but that did not work either, even though that is the format mentioned in@Aggregation
JavaDoc.What am I doing wrong? How do I pass these parameters correctly in my aggregation pipeline using Spring
@Aggregation
?The text was updated successfully, but these errors were encountered: