MongoDB

MongoDB – GridFS source code analysis, this is an introduction to GridFS from the official website. GridFS provides the ability to split a large file into multiple documents for storage. Insert into GridFS

The database supports native storage of binary data within BSON objects. However, BSON objects in MongoDB are limited in size (4MB older versions, 16MB in v1.7/1.8, higher limits in the future). The GridFS spec provides a mechanism for transparently piding a large file among multiple documents. This allows us to efficiently store large objects, and in the case of especially large files, such as videos, permits range operations (e.g., fetching only the first N bytes of a file).

This is an introduction to GridFS from the official website. GridFS provides the ability to split a large file into multiple documents for storage. When inserting a file into GridFS, two collections, fs.files and fs.chunks, are used by default for storage. The information of this file, fs.files stores the file information, and fs.chunks stores the file data.


Let’s look at the specific test code:

,

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/mongodb/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: 34331943@QQ.com

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索