Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I store blob data in MongoDB?

I want to know if it's possible to insert blob data in mongodb. What is the procedure and is any other softwares required for this?

like image 355
NAVNEET MATHPAL Avatar asked Feb 12 '14 11:02

NAVNEET MATHPAL


People also ask

How is BLOB data stored?

Blobs are stored in containers – the basic storage unit for a Microsoft Azure storage account. Containers may represent specific file types – images, for example, may be stored in one container, while video files are stored in another. Containers can be analogized to folders within a directory structure.

Is it possible to store images in MongoDB?

So for storing an image in MongoDB, we need to create a schema with mongoose. For that create the file `model. js` file and define the schema. The important point here is that our data type for the image is a Buffer which allows us to store our image as data in the form of arrays.

Can MongoDB store bytes?

MongoDB stores objects in a binary format called BSON. BinData is a BSON data type for a binary byte array. However, MongoDB objects are typically limited to 16MB in size.

How do we store data in MongoDB?

Documents are used to store data in MongoDB. These documents are saved in JSON (JavaScript Object Notation) format in MongoDB. JSON documents support embedded fields, allowing related data and data lists to be stored within the document rather than in an external table. JSON is written in the form of name/value pairs.


1 Answers

There is no problem to store large files in the database. Use mongofiles See

Article on mongodb.com

like image 76
Buschhardt Avatar answered Oct 04 '22 17:10

Buschhardt