4.6.7-alpha commit (#743)

Co-authored-by: Archer <545436317@qq.com>
Co-authored-by: heheer <71265218+newfish-cmyk@users.noreply.github.com>
This commit is contained in:
Archer
2024-01-19 11:17:28 +08:00
committed by GitHub
parent 8ee7407c4c
commit c031e6dcc9
324 changed files with 8509 additions and 4757 deletions

View File

@@ -46,8 +46,8 @@ export async function readMongoImg({ id }: { id: string }) {
return data?.binary;
}
export async function delImgByFileIdList(fileIds: string[]) {
export async function delImgByRelatedId(relateIds: string[]) {
return MongoImage.deleteMany({
'metadata.fileId': { $in: fileIds.map((item) => String(item)) }
'metadata.relatedId': { $in: relateIds.map((id) => String(id)) }
});
}

View File

@@ -35,6 +35,8 @@ try {
ImageSchema.index({ expiredTime: 1 }, { expireAfterSeconds: 60 });
ImageSchema.index({ type: 1 });
ImageSchema.index({ teamId: 1 });
ImageSchema.index({ createTime: 1 });
ImageSchema.index({ 'metadata.relatedId': 1 });
} catch (error) {
console.log(error);
}