mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-06-06 15:43:55 +02:00
add index on path and repoId for files
This commit is contained in:
@@ -179,7 +179,7 @@ export default class Repository {
|
|||||||
if (opt.recursive === false) {
|
if (opt.recursive === false) {
|
||||||
pathQuery = opt.path ? new RegExp(`^${opt.path}$`) : "";
|
pathQuery = opt.path ? new RegExp(`^${opt.path}$`) : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
const query: FilterQuery<IFile> = {
|
const query: FilterQuery<IFile> = {
|
||||||
repoId: this.repoId,
|
repoId: this.repoId,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ const FileSchema = new Schema({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
FileSchema.index({ path: 1, repoId: 1 });
|
||||||
|
|
||||||
FileSchema.methods.toString = function () {
|
FileSchema.methods.toString = function () {
|
||||||
return `${this.path}/${this.name}`;
|
return `${this.path}/${this.name}`;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user