diff --git a/src/core/Repository.ts b/src/core/Repository.ts index 1e8d508..d37ce1b 100644 --- a/src/core/Repository.ts +++ b/src/core/Repository.ts @@ -179,7 +179,7 @@ export default class Repository { if (opt.recursive === false) { pathQuery = opt.path ? new RegExp(`^${opt.path}$`) : ""; } - + const query: FilterQuery = { repoId: this.repoId, }; diff --git a/src/core/model/files/files.schema.ts b/src/core/model/files/files.schema.ts index acca6f3..a9f630c 100644 --- a/src/core/model/files/files.schema.ts +++ b/src/core/model/files/files.schema.ts @@ -12,6 +12,8 @@ const FileSchema = new Schema({ }, }); +FileSchema.index({ path: 1, repoId: 1 }); + FileSchema.methods.toString = function () { return `${this.path}/${this.name}`; };