We now allow usage of the $isolated update operator via Update.isolated().
In case isolated is set the query involved in MongoOperations.updateMulti will be enhanced by '$isolated' : 1 in case the isolation level has not already been set explicitly via eg. new BasicQuery("{'$isolated' : 0}").
Original pull request: #371.
We now drop the collections used in ReactiveMongoTemplateExecuteTests on test start to create a clean state for the tests. Previously, collections were dropped after the tests only so existing data in the collections could interfere with the tests themselves.
Fix issues pointed out by failing tests. Main focus was to restore functionality and not a Java 8 code cleanup. So, this one still needs some love and polishing.
We now make sure to safely serialize JSON output for mapped documents. This prevents the logger from rendering false exception messages to log appender.
Original pull request: #450.
Move aggregation options conversion to AggregationOptions.getMongoAggregationOptions(). Allow cursor options to control cursor batch size. Add command logging to stream execution. Rearrange method order. Close cursor in tests. Change author name from user name to full name.
Original pull request: #447.
We now support aggregation result streaming backed by a MongoDB cursor. Result streaming fetches aggregation results in batches from MongoDB and converts results as they are retrieved through the iterator.
Aggregation aggregation = …
CloseableIterator<TagCount> results = mongoOperations.aggregateStream(aggregation, "inputCollection", TagCount.class);
List<TagCount> tagCount = new ArrayList<TagCount>();
while (results.hasNext()) {
tagCount.add(results.next());
}
results.close();
Original pull request: #447.
We now make sure to safely serialize the criteria object used for creating the error message when raising an `InvalidMongoDbApiUsageException` in cases where `addCriteria` is used to add multiple entries for the same property.
Original pull request: #448.
The changes for DATAMONGO-1617 subtley changed the behavior for entity updates in terms of the version value they see for entities using optimistic locking. Previously the updates already saw the new version value, where after the fix for DATAMONGO-1617 it saw the old one. That caused BeforeConvertEvent listeners not being able to distinguish between an original insert and the first update anymore.
This change is now rolled back and we introduced a test case that encodes this expectation explicitly.
Some cleanups in MongoTemplateTests. Removed manual ID assignment in general id handling test to make sure we use the id generation. Removed unneccessary code from domain type in favor of Lombok.
Original pull request: #443.
We now make sure the BeforeConvertEvent is published before we check for identifier types that can potentially be auto-generated. That allows the event listeners to populate identifiers. Previously the identifier check kicked in before that and thus caused the listener not being able to populate the property.
Original pull request: #443.
Fix issues when placeholders are appended with other chars eg. '?0xyz' or have been reused multiple times within the query. Additional tests and fixes for complex quoted replacements eg. in regex query. Rely on placeholder quotation indication instead of binding one. Might be misleading when placeholder is used more than once.
Original pull request: #441.
Throw an IllegalArgumentException when trying to create a query using 'null' as an argument for queries resulting in a $regex query operator.
Original Pull Request: #439
Move coordinate conversion to dedicated method. Additionally fix issue with assertions applied to late in the chain and added some tests.
Original Pull Request: #438
Support Decimal128 as Mongo simple type if present. Decimal128 is stored as NumberDecimal.
class Person {
String id;
Decimal128 decimal128;
Person(String id, Decimal128 decimal128) {
this.id = id;
this.decimal128 = decimal128;
}
}
mongoTemplate.save(new Person("foo", new Decimal128(new BigDecimal("123.456"))));
is represented as:
{ "_id" : "foo", "decimal128" : NumberDecimal("123.456") }
Extend year range in license headers. Use MongoDB JSON serializer for String escaping. Move unquoting/quote checking to inner QuotedString utility class. Reformat code.
The core auditing implementation now skips the invocation of auditing in case the candidate aggregate doesn't need any auditing in the first place. We needed to adapt the sample class we use to actually carry the necessary auditing annotations.
Related ticket: DATACMNS-957.
Removed some compiler warnings. Hide newly introduced class in package scope and made use of Lombok annotations to avoid boilerplate code.
Original pull request: #436.
We now wrap the MappingMongoEntityInformation into one that delegates the methods implemented by Persistable to the actual entity in case it implements said interface.
Original pull request: #436.
Expose ReactiveMongoRepositoryConfigurationExtension so configuration extensions such as Spring Boot's ReactiveMongoRepositoriesAutoConfigureRegistrar can pick it up and reuse the repository configuration extension.