Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Retrieve data from mongodb with binary type

Tags:

mongodb

I have a site that I created using mongodb but now I want to create a new site with MySQL. I want to retrieve data from my old site (the one using mongodb). I use RoboMongo software to connect to mongodb server but I don't see my old data (*.pdf, *.doc). I think that the data is in binary, isn't it? This is my mongodb

How can I retrieve this data?

like image 645
Pham Van Son Avatar asked Dec 03 '25 12:12

Pham Van Son


1 Answers

The binary data you've highlighted is stored using a convention called GridFS. Robomongo 0.8.x doesn't support decoding GridFS binary data (see: issue #255).

In order to extract the files you'll either need to:

  • use the command line mongofiles utility included with MongoDB. For example:

    • mongofiles list to see files stored
    • mongofiles get filename to get a specific file
  • use a different program or driver that supports GridFS

like image 53
Stennie Avatar answered Dec 06 '25 05:12

Stennie



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!