Skip to content

Commit

Permalink
fix sort memory (#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
amhudson authored Jan 17, 2023
1 parent fc57e7a commit 8a4c6e2
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.Aggregation;
import org.springframework.data.mongodb.repository.Meta;
import org.springframework.data.mongodb.repository.MongoRepository;
import io.boomerang.mongo.entity.RevisionEntity;
import io.boomerang.mongo.model.WorkFlowRevisionCount;
Expand All @@ -29,13 +30,15 @@ RevisionEntity findByworkFlowIdAndVersionAndDagTasksTaskIdAndDagTasksPropertiesK
"{'$sort':{'workFlowId': -1, version: -1}}",
"{'$group': { _id: '$workFlowId', 'count': { $sum: 1 }}}"
})
@Meta(allowDiskUse = true)
List<WorkFlowRevisionCount> findWorkFlowVersionCounts(List<String> workflowIds);

@Aggregation(pipeline = {
"{'$match':{'workFlowId': {$in: ?0}}}",
"{'$sort':{'workFlowId': -1, version: -1}}",
"{'$group': { _id: '$workFlowId', 'count': { $sum: 1 }, 'latestVersion': {$first: '$$ROOT'}}}"
})
@Meta(allowDiskUse = true)
List<WorkFlowRevisionCount> findWorkFlowVersionCountsAndLatestVersion(List<String> workflowIds);

}

0 comments on commit 8a4c6e2

Please sign in to comment.