-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add support for fluent QueryResultConverter
#4949
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
base: main
Are you sure you want to change the base?
Conversation
This commit decouples queryable encryption from explicit encryption and introduces the Queryable annotation to represent different query types like range and equality. Additionally it removes value conversion from range encryption and fixes update mapping of range encrypted fields. Original Pull Request: #4885
Original Pull Request: #4885
Original Pull Request: #4885
Guard tests for encryption functionality. Original Pull Request: #4885
Closes: #4947 Signed-off-by: Jeff Yemin <[email protected]>
Remove quantization from VectorSearch docs. Closes: #4931 Signed-off-by: Alex Bevilacqua <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 21 out of 24 changed files in this pull request and generated no comments.
Files not reviewed (3)
- pom.xml: Language not supported
- spring-data-mongodb-distribution/pom.xml: Language not supported
- spring-data-mongodb/pom.xml: Language not supported
Comments suppressed due to low confidence (2)
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java:3010
- [nitpick] The unchecked cast used when comparing 'resultConverter' to QueryResultConverter.entity() could potentially lead to runtime issues. Consider refactoring this comparison to improve type safety, for example by using a more explicit identity check or redesigning the converter composition.
return resultConverter == QueryResultConverter.entity() ? (DocumentCallback<R>) readCallback : new QueryResultConverterCallback<T, R>(resultConverter, readCallback);
spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveFindOperationSupport.java:101
- [nitpick] Resetting the result converter to QueryResultConverter.entity() in the 'as()' method may inadvertently discard any existing custom converter chain. Consider preserving or composing with the current converter to ensure intended behavior when mapping to a new return type.
return new ReactiveFindSupport<>(template, domainType, returnType, QueryResultConverter.entity(), collection, query);
We now support configuring a
QueryResultConverter
that has access to the raw resultDocument
and the mapped result object that has been materialized fromMongoConverter
:This is useful to either wrap, post-process results contextually or apply further transformations based on the result
Document
. Changes apply for imperative and reactive find, geoNear and aggregations.TODO:
QueryResultConverter.entity()
(returning the converted object) is a good naming fit for queries, but with projections or aggregations we might to name it differently