Gridfs is a feature of MONGO that specializes in storing small files.
Used in the following scenarios:
1. Write file: Mongofiles put file path
Note which library the current MONGO instance is linked to, the GRIDFS system in which the file is written, and the database that is selected in the current instance is added
Fs.files used to log file information, update time, size, file name
_ID: Primary Key ID
FileName: Store file name
Chunkssize:chunks the size of the tile, in kilobytes, default 256kb
Uploaddate: Write file time
MD5: MD5 code for this file
Length: File size, Unit
Fs.chunks binary content for recording files
_ID: Primary Key ID
FILES_ID: _id primary key field corresponding to Fs.files collection
N:chunks block ordinal, starting from 0, because a file may use more than one chunks block
Value: binary content of File metadata
2. Get file: Mongofiles Get file name
Note: The retrieved file will be restored to the previously written location, and if fetched repeatedly, the action is to overwrite the contents of the last file
Mongodb--gridfs File Storage System