Cause: The copied file and source file both point to the same file in the gridfs and when one is deleted all files in gridfs matching that filename (attachment ID) is deleted.
Possible resolution: GridFsFile has the possibility of adding metadata to the document in Mongo, see if the deletion can be more specific.
test
test
folder and paste the filetest
folderThe file is no longer there:![image](https://user-images.githubusercontent.com/2814716/235170950-d98c7183-cd2c-4aab-89d6-06929a15697c.png)
Cause: The copied file and source file both point to the same file in the
gridfs
and when one is deleted all files ingridfs
matching that filename (attachment ID) is deleted.Possible resolution: GridFsFile has the possibility of adding metadata to the document in Mongo, see if the deletion can be more specific.