The JavaDoc description references the EnableJpaRepositories annotation instead of the EnableMongoRepositories annotation.
Original pull request: #340.
MongoDB 3.2 RC1 decided to remove fields from statistics JSON documents returned in case no result was found for a geo near query. The avgDistance field is unfortunately missing as of that version.
Introduced a value object to encapsulate the mitigation behavior and make client code unaware of that.
A Query instance which might be part of a NearQuery definition is now passed through the QueryMapper to make sure complex types contained in it or even in more general types that have custom conversions registered are mapped correctly before the near command is actually executed.
We now also consider the limit set via MapReduceOptions when executing mapReduce operations via MongoTemplate.mapReduce(…).
MapReduceOptions.limit(…) supersedes a potential limit set via the Query itself. This change also allows to define a limit even when no explicit Query is used.
Original pull request: #338.
We now do a defensive check against the actual WObject of WriteConcern to avoid the IllegalStateException raised by the new java-driver in case _w is null or not an Integer. This allows us to run against recent 2.13, 2.14, 3.0, 3.1 and the latest 3.2.0.
Original pull request: #337.
We now use RepositoryMetdata.getIdType() to provide a fallback identifier type in case the entity information does not hold an id property which is perfectly valid for MongoDB.
Original pull request: #333.
Previously calling the method multiple times overrode the result of previous calls. We now use addMultiFieldOperation(…) to make sure already existing values are kept.
The logger instance in AbstractMonitor is supposed to pick up the type of the actual implementation class and thus cannot be static.
Related pull request: #336.
MongoQueryCreator.nextAsArray(…) now returns a single element object array in case null is handed to the method. It previously failed with a NullPointerException.
Previously, DBObjectAccessor has always reset the in-between values when traversing nested properties. This caused previously written values to be erased if subsequent values are written. We now reuse an already existing BasicDBObject if present.
As per discussion on the ticket we now omit looking up the value for an association being used as constructor argument as the simple check whether the currently handled property is a constructor argument is sufficient to potentially skip handling the value.
Related pull requests: #335, #322.
We now check properties for their usage as constructor arguments, that might already have been resolved, before setting the actual value. This prevents turning already eagerly fetched DBRefs back into LazyLoadingProxies.
Original pull request: #335.
Related pull request: #322.
We now convert non quoted binary parameters to the $binary format. This allows using them along with the @Query annotation.
Original pull request: #332.
We now use the native id within ObjectPath for checking if a DBref has already been resolved. This is required as MongoDB Java driver 3 generation changed ObjectId.equals(…) which now performs a type check.
Original pull request: #334.
Related pull request: #288.
The presence of ObjectToObjectConverter in a DefaultConversionService causes the guard trying to register converters for ObjectIds in AbstractMongoConverter to not trigger the registration. This in turn caused ObjectId conversions to be executed via reflection instead of the straight forward method calls and thus a drop in performance for such operations.
We no unconditionally register the converters to make sure they really get applied.
Related tickets: SPR-13703.
We now also treat references as source of a potential index. This enforces index creation for Objects like:
@Document
class WithDbRef {
@Indexed@DBRef
ReferencedObject reference;
}
Combining @TextIndexed or @GeoSpatialIndexed with a DBRef will lead to a MappingException.
Original pull request: #329.
We now allow registration of ConverterFactory within CustomConversions by inspecting the generic type arguments for determining the conversion source and target types.
Original pull request: #330.
We now allow write-concern and id to be configured along with the uri or client-uri attribute of <mongo:db-factory.
Original Pull Request: #328
CLA: 140120150929074128 (Viktor Khoroshko)
Triggering data access exception translation could lead to NullPointerException in cases where PersistenceExceptionTranslator returned null because the original exception couldn't be translated and the result was directly used from a throw clause.
This is now fixed by consistently the potentiallyConvertRuntimeException(…) method, which was made static to be able to refer to it from nested static classes.
Refactored Scanner usage to actually close the Scanner instance to prevent a resource leak.