|
@@ -53,8 +53,9 @@ module.exports = function(crowi) {
|
|
|
return;
|
|
return;
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- const files = await AttachmentFile.find({ filename: { $in: filenameValues } });
|
|
|
|
|
- const idsRelatedFiles = files.map((file) => { return file._id });
|
|
|
|
|
|
|
+ const fileIds = await AttachmentFile.find({ filename: { $in: filenameValues } }, { _id: 1 });
|
|
|
|
|
+ const idsRelatedFiles = fileIds.map((file) => { return file._id });
|
|
|
|
|
+
|
|
|
await AttachmentFile.find({ filename: { $in: filenameValues } }).remove();
|
|
await AttachmentFile.find({ filename: { $in: filenameValues } }).remove();
|
|
|
await chunkCollection.deleteMany({ files_id: { $in: idsRelatedFiles } });
|
|
await chunkCollection.deleteMany({ files_id: { $in: idsRelatedFiles } });
|
|
|
|
|
|