Questions tagged [gridfs]

GridFS is a specification for storing large files in MongoDB. All of the mongodb.com supported drivers implement the GridFS spec.

GridFS is a specification for storing large files in MongoDB. MongoDB supports storing binary data directly within BSON documents, however the size is limited by the database's maximum document size (16MB as of the 1.8 production version of MongoDB; 4MB in older versions).

GridFS works by splitting large files into small "chunks", usually 256k in size.

GridFS uses two collections to store data:

  • chunks contains the binary segments of files
  • files contains metadata including the filename, content type, md5 checksum, and any optional information added by the developer

Each file saved in GridFS will have one document in the files collection and one or more documents in the chunks collection.

The GridFS collections also use a prefix (aka namespace). The default prefix is fs, so the default collection names are fs.chunks and fs.files.

GridFS collections are stored in normal MongoDB databases, and can be scaled with standard features such as replication and sharding.

Working with GridFS

All of the mongodb.org supported drivers implement the GridFS spec.

The command-line utility mongofiles can also be used to save, retrieve, list, search, and remove files in GridFS.

Related Links

1101 questions
0
votes
3 answers

Iterating through results MongoDB & GridFS (PHP)

I am using GridFS and I have currently got it to display a single image using findOne, although I would like it to iterate through all the results in the grid and echo them all to screen, here is the code I am using:
user1400312
0
votes
2 answers

Is the latest mongodb native driver mature enough to use?

Is the latest mongodb native driver mature enough to use with for instance GridFS in a production environment or as specification in a large project? Referring to http://mongodb.github.com/node-mongodb-native I would like to consider the rapid…
0
votes
2 answers

MongoDB and GridFS

We've a big existing project with thousands of users each day. We use MySQL but now we are planning to use MongoDB (and GridFS) now. Can MongoDB and GridFS be used for larger projects ?
Dev555
  • 2,128
  • 4
  • 30
  • 40
0
votes
1 answer

No errors - still no write

Getting node.js and gridfs to play nice is not easy. Of all the things I tried, I settled on this being as close as I could get with limited knowledge and what I understand the current supported functions will allow. (below in coffee, use…
-1
votes
1 answer

Where should I use sharding in mongodb or run multiple instance of mongodb?

Issue I have at least 10 text files(CSV), each reaches to 5GB in size. There is no issue when I import the first text file. But when I start importing the second text file it shows the Maximum Size Limit (16MB). My primary purpose for using the…
CyberNoob
  • 37
  • 7
-1
votes
1 answer

What's the issue which fails me to download data from mongodb using GridFS?

I am trying to write an application which functionality includes storing files in MongoDB. I succeeded in uploading files there, with the GridFS library, but then I failed many times trying to get access to the data. I constantly get a response with…
-1
votes
1 answer

ReactiveMongo GridFS error saving file from disk

I have an application that uses gridFS to store some images for things. Im using the gridFSBodyParser and controllers work. Now I need to seed some data from disk for a test for a particular edge case, for which I cannot use the controller because…
kot
  • 65
  • 1
  • 7
-1
votes
1 answer

How to create an index on the automatically generated md5 field of your GridFS storage. That way it would reject duplicates automatically

How can we create an index on the automatically generated md5 field of your GridFS storage. That way it would reject duplicates automatically.e. Thank you.
user11327631
-1
votes
1 answer

Anyone can explain about MongoDB GridFS feature?

I am one of the MongoDB user.Unfortunately i heard about MongoDB GridFS feature but i am not sure When and where to use that feature or its necessary to use.If you might be using the feature then, i hope you guys can explain precisely about this…
sampathkumar
  • 111
  • 1
  • 1
  • 9
-1
votes
1 answer

Best method suited to store and display small image in mongo database

how to store small images (< 2 MB)in mongodb and display the image on webpage without downloading it?
harish chava
  • 252
  • 2
  • 19
-1
votes
1 answer

Sending chunked files to save in mongodb

I have 2 different servers for example (Server 1 , Server 2), In the first server I have golang app which splits files and sending to second server which should save in mongodb via mgo.v2 Server 1: func mainHandle(rw http.ResponseWriter, rq…
-1
votes
1 answer

How to store files in MongoDB using Node Js and AngularJs?

I am weak in coding so I am asking this type of question. I've read similar questions but could not find out the solution to my question. All I want is to store the actual word or pdf file (and not links) in the MongoDB using NodeJs as backend and…
Himanshu K
  • 224
  • 1
  • 6
  • 17
-1
votes
2 answers

Saving and Loading Images in MongoDB 2015 using GridFS

I am using nodeJS and mongoDB to create a data entry form. Part of this form requires the user to upload an image. I have found a resource that allows you to do this but now this code is deprecated. app.use(express.bodyParser((uploadDir: __dirname +…
onemillion
  • 682
  • 5
  • 19
-1
votes
1 answer

GRIDFS driver and sample tutorial

Is there a link on where to download GRIDFS driver for Android and a sample tutorial.I appreciate it.
padlanau
  • 257
  • 3
  • 11
-1
votes
1 answer

MongoDB Update GridFS Record

I have implemented CRUD operations using PHP + MongoDB. The below code is used to upload any file using GridFS. $conn = new MongoClient(); $db = $conn->selectDB('mydb'); $gridfs = $db->getGridFS('uploads'); …
Slimshadddyyy
  • 4,085
  • 5
  • 59
  • 121
1 2 3
73
74