在 Mongodb 中存储 100 MB 的大文件

2022-01-13 00:00:00 mongodb nosql php

我想在 MongoDB 中存储 100MB 到 1GB 的大文件,就像 BLOB 对象一样,以后可以更容易地检索它.我使用的编程语言是 PHP请在这个意义上指导我.

I want to store Large file of 100MB to 1GB in MongoDB just like BLOB object and later on can easier retrieve it. The programming language that i am using is PHP Please guide me in this sense.

推荐答案

您需要为此使用 GridFS,因为通常 MongoDB 文档限制为 16MB.请参阅 http://www.php.net 的 PHP 文档中的概述和示例/manual/en/class.mongogridfs.php

You need to use GridFS for this as normally MongoDB documents are limited to 16MB. See the overview and examples in the PHP documentation at http://www.php.net/manual/en/class.mongogridfs.php

相关文章