Mongodb--gridfs File Storage System

Source: Internet
Author: User
Tags md5

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.