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?
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.
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.
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.
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.
There is no problem to store large files in the database. Use mongofiles
See
Article on mongodb.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With