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

Add support for aggregation operators $dateFromString, $dateFromParts and $dateToParts [DATAMONGO-1834] #2736

Closed
spring-projects-issues opened this issue Nov 30, 2017 · 8 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Nov 30, 2017

Christoph Strobl opened DATAMONGO-1834 and commented


Reference URL: https://docs.mongodb.com/v3.6/release-notes/3.6/#new-aggregation-operators

Referenced from: pull request #539

Backported to: 2.0.6 (Kay SR6), 1.10.11 (Ingalls SR11)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 20, 2018

Matthew Morrissette commented

All functions implemented in pull request:
#539

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 21, 2018

Christoph Strobl commented

@Matthew Morrissette thanks a lot for the PR!

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 21, 2018

Matthew Morrissette commented

Anytime! Btw I also have another commit ready that merges this change into the 1.10.x branch for Spring 4.x support as well. Once this pull request is finalized, I'll make any requested changes to the other branch and submit another pull request

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 27, 2018

Christoph Strobl commented

@Matthew Morrissette we changed a couple of things and have therefore opened a branch to get the changes in. You might want to have a look before we actually merge it to master. Since we're already close to the next SR for Ingalls we can take care of the back port if you do not have the time

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 27, 2018

Matthew Morrissette commented

Looked over all your changes. I understand your reasoning behind the differences. Everything looks great from my point of view.

I see you dropped support for my business "Quarter" related methods and class. While I know Mongo doesn't support it out of box right now, I can definitely see it supporting it in the future (most SQL derivatives do) but the implementation I created works for all Mongo versions. It's a really useful concept when building business functionality around dates (especially when creating groupings by business quarter). Any chance we could get that added (even if we have to do it with another issue)?

If you won't consider accepting the suggestion, can you at least increase the visibility of some members inside DateOperators (i.e. ZonedDateAggregationExpression class and constructor, applyTimezone() method, argumentMap() methods (multiple plates), fields of DateOperatorFactory and ZonedDateAggregationExpression, dateReference() method of DateOperatorFactory) to be protected or public instead of private. That will at least allow others to extend the functionality if they wanted to.

Yeah, if you could get the backport that would be very helpful. I'm swamped right now

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 28, 2018

Christoph Strobl commented

Thanks for looking over the changes. We've discussed the Quarter expression within the team and decided that we're not going to add it as long as there's no native operator for it. We'll open up and change visibility for ZonedDateAggregationExpression.

I'll do the port to 1.10.x for the upcoming SR. A snapshot spring-data-mongodb:1.10.11.DATAMONGO-1834-SNAPSHOT including the changes should already be available via https://repo.spring.io

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Mar 28, 2018

Matthew Morrissette commented

Sounds good. Thank you! I'll implement the feature in Mongo native and see if I can get it accepted :)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Sep 10, 2018

Shubhada Bhat commented

Hi Matt/Chris,

Is it possible to give a sample usage example of dateFromParts and dateToParts? Given that I have date value stored in one of fields in the document and I intend to use these aggregation date operations to tweak the date values slightly.

 

Regards

Shubhada

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants