attempt to fix indexes
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 });
|
||||
|
||||
Reference in New Issue
Block a user