|
|
|
@ -945,7 +945,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, |
|
|
|
DocumentCallback<GeoResult<T>> callback = new GeoNearResultDocumentCallback<>(distanceField, |
|
|
|
DocumentCallback<GeoResult<T>> callback = new GeoNearResultDocumentCallback<>(distanceField, |
|
|
|
new ProjectingReadCallback<>(mongoConverter, projection, collection), near.getMetric()); |
|
|
|
new ProjectingReadCallback<>(mongoConverter, projection, collection), near.getMetric()); |
|
|
|
|
|
|
|
|
|
|
|
List<GeoResult<T>> result = new ArrayList<>(); |
|
|
|
List<GeoResult<T>> result = new ArrayList<>(results.getMappedResults().size()); |
|
|
|
|
|
|
|
|
|
|
|
BigDecimal aggregate = BigDecimal.ZERO; |
|
|
|
BigDecimal aggregate = BigDecimal.ZERO; |
|
|
|
for (Document element : results) { |
|
|
|
for (Document element : results) { |
|
|
|
@ -1311,7 +1311,7 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, |
|
|
|
|
|
|
|
|
|
|
|
Assert.notNull(writer, "MongoWriter must not be null"); |
|
|
|
Assert.notNull(writer, "MongoWriter must not be null"); |
|
|
|
|
|
|
|
|
|
|
|
List<Document> documentList = new ArrayList<>(); |
|
|
|
List<Document> documentList = new ArrayList<>(batchToSave.size()); |
|
|
|
List<T> initializedBatchToSave = new ArrayList<>(batchToSave.size()); |
|
|
|
List<T> initializedBatchToSave = new ArrayList<>(batchToSave.size()); |
|
|
|
for (T uninitialized : batchToSave) { |
|
|
|
for (T uninitialized : batchToSave) { |
|
|
|
|
|
|
|
|
|
|
|
@ -2717,7 +2717,8 @@ public class MongoTemplate implements MongoOperations, ApplicationContextAware, |
|
|
|
.initiateFind(getAndPrepareCollection(doGetDatabase(), collectionName), collectionCallback::doInCollection) |
|
|
|
.initiateFind(getAndPrepareCollection(doGetDatabase(), collectionName), collectionCallback::doInCollection) |
|
|
|
.iterator()) { |
|
|
|
.iterator()) { |
|
|
|
|
|
|
|
|
|
|
|
List<T> result = new ArrayList<>(); |
|
|
|
int available = cursor.available(); |
|
|
|
|
|
|
|
List<T> result = available > 0 ? new ArrayList<>(available) : new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
while (cursor.hasNext()) { |
|
|
|
while (cursor.hasNext()) { |
|
|
|
Document object = cursor.next(); |
|
|
|
Document object = cursor.next(); |
|
|
|
|