MongoDB and GridFS file system
GridFS is used to store and restore files that exceed 16M (BSON file limit). GridFS divides files into large blocks and stores each large block as a separate file. The maximum chunk limit in GridFS is 256k. GridFS uses two collection stores, one for chunks and one for metadata. fs.files and fs.chunks When should I use GridFS? http://docs.mongodb.org/manual/faq/developers/#faq-developers-when-to-use-gridfs the file Collection: the specific form is as follows { “_id” : , “length” : , “chunkSize” : “uploadDate” : “md5” : “filename”: , “contentType” : , “aliases” : , “metadata” : , } Documents in the files collection contain some or all of the following fields. Applications may create additional arbitrary fields: files._id The unique ID for this document. The _id is of the data type you chose for the original document. The default type for MongoDB documents is BSON ObjectID. files. length The size of the document in bytes. files.chunkSize The size of each chunk. GridFS divides the document into chunks of the size specified here. The default size is 256 kilobytes. files.uploadDate The date the document was first stored by GridFS. This value has the Date type. files.md5 An MD5 hash returned from the filemd5 API. This value has…