attempt to fix indexes

This commit is contained in:
subnub
2024-12-27 19:10:35 -05:00
parent 0a16d3c6cc
commit 441cce3027
2 changed files with 1 additions and 58 deletions
+1 -56
View File
@@ -97,70 +97,15 @@ export interface FileInterface
fileSchema.index(
{ "metadata.owner": 1, "metadata.parent": 1, filename: 1 },
{ background: true }
{ collation: { locale: "en", strength: 2 }, background: true }
);
fileSchema.index(
{ "metadata.owner": 1, "metadata.parent": 1, uploadDate: 1 },
{ background: true }
);
fileSchema.index(
{ "metadata.owner": 1, "metadata.parent": 1, filename: 1 },
{ background: true }
);
fileSchema.index(
{ "metadata.owner": 1, "metadata.parent": 1, uploadDate: 1 },
{ collation: { locale: "en", strength: 2 }, background: true }
);
fileSchema.index(
{ "metadata.owner": 1, "metadata.parent": 1, filename: 1 },
{ collation: { locale: "en", strength: 2 }, background: true }
);
fileSchema.index({ "metadata.owner": 1 }, { background: true });
fileSchema.index({ "metadata.parent": 1 }, { background: true });
fileSchema.index({ uploadDate: 1 }, { background: true });
fileSchema.index({ "metadata.trashed": 1 }, { background: true });
fileSchema.index({ "metadata.hasThumbnail": 1 }, { background: true });
fileSchema.index(
{ filename: 1 },
{ collation: { locale: "en", strength: 2 }, background: true }
);
fileSchema.index(
{ "metadata.parent": 1 },
{ collation: { locale: "en", strength: 2 }, background: true }
);
fileSchema.index(
{ "metadata.owner": 1 },
{ collation: { locale: "en", strength: 2 }, background: true }
);
// fileSchema.index(
// { filename: 1 },
// { collation: { locale: "en", strength: 2 }, background: true }
// );
// fileSchema.index(
// { filename: -1 },
// { collation: { locale: "en", strength: 2 }, background: true }
// );
// fileSchema.index({ uploadDate: 1 }, { background: true });
// fileSchema.index({ uploadDate: -1 }, { background: true });
// fileSchema.index({ "metadata.parent": 1 }, { background: true });
// fileSchema.index({ "metadata.owner": 1 }, { background: true });
// fileSchema.index({ "metadata.isVideo": 1 }, { background: true });
// fileSchema.index({ "metadata.hasThumbnail": 1 }, { background: true });
// fileSchema.index({ "metadata.trashed": 1 }, { background: true });
const File = mongoose.model<FileInterface>("fs.files", fileSchema);
export default File;
-2
View File
@@ -46,8 +46,6 @@ export interface FolderInterface
trashed: boolean | null;
}
folderSchema.index({ owner: 1, parent: 1, name: 1 }, { background: true });
folderSchema.index({ owner: 1, parent: 1, createdAt: 1 }, { background: true });
folderSchema.index({ createdAt: 1 }, { background: true });
folderSchema.index({ owner: 1 }, { background: true });
folderSchema.index({ trashed: 1 }, { background: true });