NAVNEET MATHPAL
NAVNEET MATHPAL

Reputation: 170

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?

Upvotes: 12

Views: 37838

Answers (2)

Buschhardt
Buschhardt

Reputation: 171

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

Article on mongodb.com

Upvotes: 5

Neil Lunn
Neil Lunn

Reputation: 151122

Absolutely not. And before some fool just responds "GridFS", please read the documentation in the link.

Now that you have actually read the docs, consider that your blob (binary) data is probably under the 16MB BSON limitation. In which case, the answer is just Base64 encode it and put it into a field of your document.

Very Simple.

Upvotes: 4

Related Questions