您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

MongoDB

2024/2/26 18:57:53发布10次查看
mongodb - gridfs源码分析,这是官网的一段gridfs的介绍. gridfs是提供了把一个大文件切分成多个document来存储的. 向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 dividing 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).
这是官网的一段gridfs的介绍. gridfs是提供了把一个大文件切分成多个document来存储的. 向gridfs中插入一个文件, 默认使用fs.files和fs.chunks两个collection来存储此文件的信息的, 其中fs.files存放了文件的信息, fs.chunks存放了文件的数据. 
下面看具体测试代码:

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product