Is there any way to add time out parameter maxTimeMs in the below query? I want the aggregation to time out after 1 minutes

List<AggregationOperation> aggregationOperations = getAggregationOperations();

Aggregation aggregation = newAggregation(aggregationOperations)
                        .cursor(new Document("batchSize", 99))

List<Document> responseList = mongoTemplate.aggregate(aggregation, collectionName, Document.class).getRawResults().get("results", List.class);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.