Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have uploaded PDF/PST file in mongodb by mongofiles but by retrieving them in R(BSON) and converting it to "Character" type i didnt find the PDF/PST file,so is it possible to upload PDF file or PST file ? which file format doest mongodb support(other then CSV,TSV,TXT,audio) ? -Thanks

share|improve this question

BSON has a Binary data type in which you can store anything you want. MongoDB sees it as a binary blob and does not care what type of data it is, so of course ot is possible to store PDF files. MongoDB documents are limited to 16 MB in size, so if you need to store large data, try GridFS.

share|improve this answer
Can you please tell me how to recover that data into txt format from BSON in R – Aashu Aug 20 '13 at 13:38

I think you are confusing the ability to store files with the ability to translate between file types - your database is not going to change a PDF into a text file (or any other type of file), it will allow you to store a PDF file, as a binary blob, then retrieve that file later in exactly the same format (whether you store it directly or you use GridFS). For straight file storage, any file format is supported - and it can be any file type, format - it can even be invalid. It's just a bunch of binary data from the database perspective.

If you want to convert between types or examine files in general you need to use some sort of translation utility to do so - in your language of choice.

share|improve this answer
I do know we can upload any kind of file but here the question is ,do we really have to upload a non readable file because it seems to be impossible to get it back after uploading(BSON).for ex. after uploading a pst file and reading readBin(#reading BSON),i did not get the text. – Aashu Aug 30 '13 at 6:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.