关于gridfs的问题
正如我们在 GridFS 文档 中看到的,BSON 对象的大小是有限的。因此,如果我想存储非常大的东西,我需要将其分成块。它将是 fs.files 集合中的一个文档。我的问题是:有没有办法在文档中拥有巨大的字段。这样就可以在不查找 fs.files 集合的情况下找到它。
先感谢您!
As one can see in GridFS doc, BSON objects are limited in size. So if I want to store something extremely big, I need to separate it on chunks. It'll be a document in fs.files collection. My question is: is there a way to have huge fields in document. so that it can be found without looking in fs.files collection.
Thank you in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不可以。BSON 文档有 16mb 的硬性限制,因此各个字段永远不能超过此大小限制。 GridFS 正是通过在多个较小的段之间透明地分块较大的文件来解决该限制。
No. BSON documents have a hard 16mb limit so individual fields can never exceed this size limitation. It is exactly that limitation GridFS is working around by transparently chunking a larger file amongst multiple smaller segments.