This commit switches the rendering of UUID values to their toString format when printing org.bson.Document to json via the DocumentToString converter.
This will move the resulting representation from {"$binary": "QUK3ZihZ9cdhWjTf5TZqrw==", "$type": "03"} to 480971b0-7160-4120-acd0-6fd6b82418ad which is the more natural variant within Java applications.
The conversion only applies on read in cases where an entire document eg. a composite id, is mapped to a String property of the domain model.
Closes#3546.
Original pull request: #3551.
This commit makes sure to use an Encoder having UuidRepresentation set when calling org.bson.Document#toJson, preventing CodecConfigurationException from being raised.
Future versions will make sure the UUID string representation matches the Java default one.
Closes#3546.
Original pull request: #3551.
We now support embedded types in the sense of unwrapping nested objects into their parent Document to flatten out domain models where needed.
A domain class of:
public class User {
@Id
private String userId;
@Embedded(onEmpty = USE_NULL)
private UserName name;
}
public class UserName {
private String firstname;
private String lastname;
}
renders:
{
"_id" : "1da2ba06-3ba7",
"firstname" : "Emma",
"lastname" : "Frost"
}
Resolves#2803.
Original pull request: #896.
This commit reduces the visibility of the GeoJsonSerializersModule and instead offers static methods on GeoJsonModule allowing to obtain those via a static method.
The actual serialization was simpified by moving some of its code to a common base class.
Updated reference documentation - relates to: spring-projects/spring-data-commons#2288
We also did, by intent, not change the current GeoJsonModule to add the serializers by default in order to give users time to prepare for that change which will be done with the next major release.
Original pull request: #3539.
Closes#3517
By offering a getter method for the ReactiveMongoDatabaseFactory users subclassing ReactiveMongoTemplate could evaluate the current transaction state via ReactiveMongoDatabaseUtils.isTransactionActive(getDatabaseFactory()).
This change also aligns the reactive and imperative template implementation in that regard.
Closes#3540
Original pull request: #3541.
Align type variable naming with imperative extensions(I, O). Add extension without accepting KClass. Update since tags and tests.
See #3508.
Original pull request: #893.
Tweak wording in the docs. Remove unused code. Fix generics. Rename AggregateContext to AggregationOperation to AggregationDefinition to avoid yet another Context object.
See #3542.
Original pull request: #3545.
This commit switches from a strict to a relaxed type mapping for aggregation executions. This allows users to add fields to the aggregation that might be part of the stored document but not necessarily of its java model representation.
Instead of throwing an exception in those cases the relaxed type check will go on with the user provided field names.
To restore the original behaviour use the strictMapping() option on AggregationOptions.
Closes#3542
Original pull request: #3545.
Update Javadoc to reflect find and aggregation nature. Use primitive boolean on Query.allowDiskUse to avoid nullable type usage. Update ReactiveMongoTemplate to consider allowDiskUse.
Original pull request: #891.