mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-09-18 16:42:16 +02:00
perf: cut MongoDB scans in repository workflows (#780)
* Add repository name index * Optimize repository file counts * Optimize MongoDB query workloads
This commit is contained in:
@@ -196,7 +196,7 @@ router.get(
|
||||
const repoId = repo.repoId;
|
||||
const results = await FileModel.aggregate([
|
||||
{ $match: { repoId, size: { $ne: null } } },
|
||||
{ $project: { path: 1 } },
|
||||
{ $project: { _id: 0, path: 1 } },
|
||||
{ $group: { _id: "$path", count: { $sum: 1 } } },
|
||||
]).exec();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user