This commit introduces the new `@Hint` annotation that allows to override MongoDB's default index selection for repository query, update and aggregate operations.
```
@Hint("lastname-idx")
List<Person> findByLastname(String lastname);
@Query(value = "{ 'firstname' : ?0 }", hint="firstname-idx")
List<Person> findByFirstname(String firstname);
```
Closes: #3230
Original pull request: #4339
This commit makes sure to return null for a null parameter value avoiding a potential NPE when parsing data.
In doing so we can ensure object creation is done with the intended value that may or may not lead to a downstream error eg. when trying to create an ObjectId with a null hexString.
Closes: #4282
Original pull request: #4334
This commit makes sure to use the ProxyFactory for retrieving the proxied interfaces. This makes sure to capture the exact interface order required when finally loading the proxy at runtime.
Original pull request: #4352Closes#4351
In preparation of spring-projects/spring-data-commons#2813 we're moving off the implementation of PersistentPropertyPathAccessor and rather only implement PersistenPropertyAccessor.
Fixes#4354.
We now correctly scroll backwards by reversing sort order to apply the correct limit and reverse the results again to restore the actual sort order.
Closes#4332
Along the lines fix entity operations proxy handling by reading the underlying map instead of inspecting the proxy interface.
Also make sure to map potential raw fields back to the according property.
See: #4308
Original Pull Request: #4317
Follow the changes in data commons that renamed scroll to window.
Also error when a certain scroll position does not allow creating a query out of it because of null values.
See: #4308
Original Pull Request: #4317
This commit fixes an issue where the context is not relaxed and errors on unknown fields if multiple stages of nesting contexts happen.
Closes#3917
Original pull request: #4328
This commit fixes an issue where a property value converter is not applied if the query is using an $in clause that compares the value against a collection of potential candidates.
Closes#4080
Original pull request: #4324
This commit adds the ability to read (eg. by an aggregation $lookup) already fully resolved references between documents.
No proxy will be created for lazy loading references and we'll also skip the additional server roundtrip to load the reference by its id.
Closes#4312
Original pull request: #4323
Remove caching variant of MongoClientEncryption. Rename types for consistent key alt name scheme. Rename annotation to ExplicitEncrypted.
Add package-info. Improve documentation wording. Reduce visibility of KeyId and KeyAltName to package-private.
Original pull request: #4302
See: #4284
We now support explicit field encryption using mapped entities through the `@ExplicitEncrypted` annotation.
class Person {
ObjectId id;
@ExplicitEncrypted(algorithm = AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic, altKeyName = "my-secret-key")
String socialSecurityNumber;
}
Encryption is applied transparently to all mapped entities leveraging the existing converter infrastructure.
Original pull request: #4302Closes: #4284
This commit makes sure to read query hints and apply them to the MongoDB UpdateOptions when running an update via Reactive-/MongoTemplate.
Original pull request: #4311Closes: #3218
This commit introduces AggregationExpressionCriteria to be used along with Query to run an $expr operator within the find query.
query(whereExpr(valueOf("spent").greaterThan("budget")))
Closes: #2750
Original pull request: #4316.
This commit fixes a regression that prevented native org.bson.Document to serve as source for a findAndReplaceOperation.
Closes: #4300
Original Pull Request: #4310
Implement ReadConcernAware and ReadPreferenceAware for NearQuery and make sure those get applied when working with the template API.
Original Pull Request: #4288