Media Type MongoDB Collection
Purpose
This collection of file type extensions and Media Types is useful for back-end developers creating web-based email applications, file management systems or file streaming sites.
In the context of email, we use the term MIME type. In the context of web applications, Content-Type is more appropriate. The database field name used in this MongoDB collection is |
By leveraging MongoDB’s built-in ability to assign an array to a field, the equivalent of a column in relational database terminology, we can more easily query database schemata representing one-to-many relationships.
In this case the ext
field name represents filename extensions, such that querying for any one of the potential extensions in a 1-mime
-to-many-ext
’s data model requires only a single query without the need for multiple tables with joins.
A Sample Query
Query for the diff
file extension:
db.getCollection("contentType").find(
{ "ext" : "diff" }
).pretty()
As expected, only one document was returned.
{
"type" : "Document",
"name" : "Plain Text",
"mime" : "text/plain",
"ext" : [
"asc",
"diff",
"dsp",
"patch",
"txt"
]
}
The Collection
[
{
"type" : "Miscellaneous",
"name" : "Adobe Illustrator",
"mime" : "application/ai",
"ext" : "ai"
},
{
"mime" : "audio/x-aiff",
"ext" : [
"aif",
"aifc",
"aiff"
]
},
{
"type" : "Document",
"name" : "Plain Text",
"mime" : "text/plain",
"ext" : [
"asc",
"diff",
"dsp",
"patch",
"txt"
]
},
{
"type" : "Document",
"name" : "AsciiDoc",
"mime" : "text/asciidoc",
"ext" : "adoc"
},
{
"mime" : "audio/basic",
"ext" : [
"au",
"snd"
]
},
{
"type" : "Video",
"name" : "Microsoft Video for Windows Movie",
"mime" : "video/x-msvideo",
"ext" : "avi"
},
{
"type" : "Script",
"name" : "UNIX/Linux Shell Script",
"mime" : "application/x-sh",
"ext" : [
"csh",
"bash",
"ksh",
"sh",
"tcsh"
]
},
{
"type" : "Script",
"name" : "Microsoft Batch Processing",
"mime" : "application/bat",
"ext" : "bat"
},
{
"mime" : "application/x-bcpio",
"ext" : [
"bcpio"
]
},
{
"type" : "Disk Image",
"name" : "CDRWIN Binary Data",
"mime" : "application/octet-stream",
"ext" : "bin"
},
{
"type" : "Image",
"name" : "Windows Bitmap Image",
"mime" : "image/bmp",
"ext" : "bmp"
},
{
"mime" : "application/x-bzip2",
"ext" : [
"bz2"
]
},
{
"mime" : "text/x-c",
"ext" : [
"c",
"h"
]
},
{
"mime" : "application/vnd.ms-cab-compressed",
"ext" : [
"cab"
]
},
{
"mime" : "application/x-netcdf",
"ext" : [
"cdf",
"nc"
]
},
{
"type" : "Application",
"name" : "Java compiled binary for JVM",
"mime" : "application/java-vm",
"ext" : "class"
},
{
"mime" : "application/x-cpio",
"ext" : [
"cpio"
]
},
{
"type" : "Image",
"name" : "Corel Photo-Paint Image",
"mime" : "image/x-cpt",
"ext" : "cpt"
},
{
"mime" : "application/x-x509-ca-cert",
"ext" : [
"crt"
]
},
{
"type" : "Script",
"name" : "Cascading Style Sheets",
"mime" : "text/css",
"ext" : "css"
},
{
"type" : "Document",
"name" : "Comma-Separated Values Spreadsheet",
"mime" : "text/comma-separated-values",
"ext" : "csv"
},
{
"type" : "Database",
"name" : "Database",
"mime" : "application/db",
"ext" : "db"
},
{
"mime" : "application/x-director",
"ext" : [
"dcr",
"dir",
"dxr"
]
},
{
"type" : "Archive",
"name" : "Debian Package",
"mime" : "application/x-debian-package",
"ext" : "deb"
},
{
"type" : "Disk Image",
"name" : "Mac OS X Disk Image",
"mime" : "application/x-apple-diskimage",
"ext" : "dmg"
},
{
"type" : "Document",
"name" : "Microsoft Word Document",
"mime" : "application/msword",
"ext" : "doc"
},
{
"type" : "Document",
"name" : "Microsoft Office Word 2007 Document with macros",
"mime" : "application/vnd.ms-word.document.macroEnabled.12",
"ext" : "docm"
},
{
"type" : "Document",
"name" : "Microsoft Office Open XML Format Word Document",
"mime" : "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"ext" : "docx"
},
{
"type" : "Document",
"name" : "Microsoft Word Document Template",
"mime" : "application/msword",
"ext" : "dot"
},
{
"mime" : "application/vnd.ms-word.template.macroEnabled.12",
"ext" : [
"dotm"
]
},
{
"type" : "Document",
"name" : "Microsoft Office Open XML Format Word Document Template",
"mime" : "application/vnd.openxmlformats-officedocument.wordprocessingml.template",
"ext" : "dotx"
},
{
"mime" : "application/x-dvi",
"ext" : [
"dvi"
]
},
{
"mime" : "video/dvx",
"ext" : [
"dvx"
]
},
{
"type" : "Drawing",
"name" : "Autodesk AutoCAD Drawing",
"mime" : "application/x-autocad",
"ext" : "dwg"
},
{
"type" : "Drawing",
"name" : "AutoCAD Drawing eXchange File",
"mime" : "application/dxf",
"ext" : "dxf"
},
{
"type" : "Email",
"name" : "Microsoft Outlook Express Message",
"mime" : "message/rfc822",
"ext" : "eml"
},
{
"type" : "Image",
"name" : "Encapsulated PostScript",
"mime" : "application/eps",
"ext" : "eps"
},
{
"mime" : "application/zip",
"ext" : [
"zip",
"epub"
]
},
{
"mime" : "text/x-setext",
"ext" : [
"etx"
]
},
{
"type" : "Application",
"name" : "Microsoft Executable",
"mime" : "application/octet-stream",
"ext" : "exe"
},
{
"type" : "Video",
"name" : "Adobe Flash Video",
"mime" : "video/x-flv",
"ext" : "flv"
},
{
"type" : "Image",
"name" : "Graphics Interchange Format",
"mime" : "image/gif",
"ext" : "gif"
},
{
"mime" : "application/x-gtar",
"ext" : [
"gtar"
]
},
{
"type" : "Archive",
"name" : "gzip",
"mime" : "application/x-gzip",
"ext" : [
"gz",
"tgz"
]
},
{
"mime" : "application/x-hdf",
"ext" : [
"hdf"
]
},
{
"type" : "Archive",
"name" : "Macintosh BinHex 4 Compressed Archive",
"mime" : "application/mac-binhex40",
"ext" : "hqx"
},
{
"type" : "Document",
"name" : " Hypertext Markup Language Document",
"mime" : "text/html",
"ext" : [
"htm",
"html"
]
},
{
"mime" : "x-conference/x-cooltalk",
"ext" : [
"ice"
]
},
{
"mime" : "text/calendar",
"ext" : [
"ics"
]
},
{
"mime" : "image/ief",
"ext" : [
"ief"
]
},
{
"mime" : "model/iges",
"ext" : [
"iges",
"igs"
]
},
{
"mime" : "text/x-m4",
"ext" : [
"in",
"m4"
]
},
{
"type" : "Archive",
"name" : "Java Archive",
"mime" : "application/java-archive",
"ext" : "jar"
},
{
"type" : "Image",
"name" : "JPEG Bitmap Image",
"mime" : "image/jpeg",
"ext" : [
"jpg",
"jpeg",
"jpe"
]
},
{
"type" : "Script",
"name" : "Javascript",
"mime" : "application/x-javascript",
"ext" : "js"
},
{
"mime" : "audio/midi",
"ext" : [
"kar",
"mid",
"midi"
]
},
{
"mime" : "application/x-latex",
"ext" : [
"latex"
]
},
{
"type" : "Archive",
"name" : "LHarc Compressed Archive",
"mime" : "application/x-lzh-compressed",
"ext" : "lzh"
},
{
"mime" : "application/x-troff-man",
"ext" : [
"man"
]
},
{
"type" : "Document",
"name" : "Markdown",
"mime" : "text/markdown",
"ext" : "md"
},
{
"type" : "Database",
"name" : "Microsoft Access",
"mime" : "application/access",
"ext" : "mdb"
},
{
"mime" : "image/vnd.ms-modi",
"ext" : [
"mdi"
]
},
{
"mime" : "application/x-troff-me",
"ext" : [
"me"
]
},
{
"mime" : "model/mesh",
"ext" : [
"mesh",
"msh",
"silo"
]
},
{
"type" : "Document",
"name" : "MHTML Web Archive",
"mime" : "application/octet-stream",
"ext" : "mht"
},
{
"mime" : "application/vnd.mif",
"ext" : [
"mif"
]
},
{
"mime" : "video/x-matroska",
"ext" : [
"mkv"
]
},
{
"type" : "Video",
"name" : "QuickTime Movie",
"mime" : "video/quicktime",
"ext" : "mov"
},
{
"mime" : "video/x-sgi-movie",
"ext" : [
"movie"
]
},
{
"mime" : "audio/mpeg",
"ext" : [
"mp3",
"mp2",
"mpga"
]
},
{
"type" : "Video",
"name" : "MPEG-4 Video Container",
"mime" : "video/mp4",
"ext" : "mp4"
},
{
"type" : "Video",
"name" : "MPEG Video",
"mime" : "video/mpeg",
"ext" : "mpg"
},
{
"type" : "Document",
"name" : "Microsoft Project Plan",
"mime" : "application/vnd.ms-project",
"ext" : "mpp"
},
{
"mime" : "application/x-troff-ms",
"ext" : [
"ms"
]
},
{
"type" : "Email",
"name" : "Microsoft Outlook Message",
"mime" : "application/msoutlook",
"ext" : "msg"
},
{
"mime" : "application/x-msi",
"ext" : [
"msi"
]
},
{
"mime" : "application/vnd.oasis.opendocument.database",
"ext" : [
"odb"
]
},
{
"mime" : "application/vnd.oasis.opendocument.chart",
"ext" : [
"odc"
]
},
{
"mime" : "application/vnd.oasis.opendocument.formula",
"ext" : [
"odf"
]
},
{
"mime" : "application/vnd.oasis.opendocument.graphics",
"ext" : [
"odg"
]
},
{
"mime" : "application/vnd.oasis.opendocument.image",
"ext" : [
"odi"
]
},
{
"mime" : "application/vnd.oasis.opendocument.text-master",
"ext" : [
"odm"
]
},
{
"type" : "Document",
"name" : "OpenDocument Presentation",
"mime" : "application/vnd.oasis.opendocument.presentation",
"ext" : "odp"
},
{
"type" : "Document",
"name" : "OpenDocument Spreadsheet",
"mime" : "application/vnd.oasis.opendocument.spreadsheet",
"ext" : "ods"
},
{
"type" : "Document",
"name" : "OpenDocument Text",
"mime" : "application/vnd.oasis.opendocument.text",
"ext" : "odt"
},
{
"mime" : "application/vnd.oasis.opendocument.chart-template",
"ext" : [
"otc"
]
},
{
"mime" : "application/vnd.oasis.opendocument.formula-template",
"ext" : [
"otf"
]
},
{
"mime" : "application/vnd.oasis.opendocument.graphics-template",
"ext" : [
"otg"
]
},
{
"mime" : "application/vnd.oasis.opendocument.text-web",
"ext" : [
"oth"
]
},
{
"mime" : "application/vnd.oasis.opendocument.image-template",
"ext" : [
"oti"
]
},
{
"mime" : "application/vnd.oasis.opendocument.presentation-template",
"ext" : [
"otp"
]
},
{
"mime" : "application/vnd.oasis.opendocument.spreadsheet-template",
"ext" : [
"ots"
]
},
{
"mime" : "application/vnd.oasis.opendocument.text-template",
"ext" : [
"ott"
]
},
{
"mime" : "image/x-portable-bitmap",
"ext" : [
"pbm"
]
},
{
"mime" : "chemical/x-pdb",
"ext" : [
"pdb",
"xyz"
]
},
{
"type" : "Document",
"name" : "Adobe Portable Document Format",
"mime" : "application/pdf",
"ext" : "pdf"
},
{
"type" : "Certificate",
"name" : "Base64 Encoded Certificate",
"mime" : "application/x-x509-user-cert",
"ext" : [
"pem"
]
},
{
"mime" : "image/x-portable-graymap",
"ext" : [
"pgm"
]
},
{
"mime" : "application/x-chess-pgn",
"ext" : [
"pgn"
]
},
{
"mime" : "text/x-php",
"ext" : [
"php"
]
},
{
"mime" : "text/x-perl",
"ext" : [
"pl",
"pm"
]
},
{
"mime" : "application/xml",
"ext" : [
"plist"
]
},
{
"type" : "Image",
"name" : "Portable Network Graphics Image",
"mime" : "image/png",
"ext" : "png"
},
{
"mime" : "image/x-portable-anymap",
"ext" : [
"pnm"
]
},
{
"mime" : "application/vnd.ms-powerpoint.template.macroEnabled.12",
"ext" : [
"potm"
]
},
{
"mime" : "application/vnd.openxmlformats-officedocument.presentationml.template",
"ext" : [
"potx"
]
},
{
"mime" : "application/vnd.ms-powerpoint.addin.macroEnabled.12",
"ext" : [
"ppam"
]
},
{
"mime" : "image/x-portable-pixmap",
"ext" : [
"ppm"
]
},
{
"type" : "Document",
"name" : "Microsoft PowerPoint Slideshow",
"mime" : "application/vnd.ms-powerpoint",
"ext" : "pps"
},
{
"mime" : "application/vnd.ms-powerpoint.slideshow.macroEnabled.12",
"ext" : [
"ppsm"
]
},
{
"type" : "Document",
"name" : "Microsoft Office Open XML Format Presentation Slideshow",
"mime" : "application/vnd.openxmlformats-officedocument.presentationml.slideshow",
"ext" : "ppsx"
},
{
"type" : "Document",
"name" : "Microsoft PowerPoint Presentation",
"mime" : "application/vnd.ms-powerpoint",
"ext" : "ppt"
},
{
"type" : "Document",
"name" : "Microsoft Office PowerPoint 2007 Presentation with macros",
"mime" : "application/vnd.ms-powerpoint.presentation.macroEnabled.12",
"ext" : "pptm"
},
{
"type" : "Document",
"name" : "Microsoft Office Open XML Format Presentation",
"mime" : "application/vnd.openxmlformats-officedocument.presentationml.presentation",
"ext" : "pptx"
},
{
"type" : "Document",
"name" : "PostScript",
"mime" : "application/postscript",
"ext" : "ps"
},
{
"mime" : "audio/x-realaudio",
"ext" : [
"ra"
]
},
{
"type" : "Audio",
"name" : "RealAudio",
"mime" : "audio/x-pn-realaudio",
"ext" : [
"ram"
]
},
{
"type" : "Archive",
"name" : "WinRAR Archive",
"mime" : "application/x-rar-compressed",
"ext" : "rar"
},
{
"mime" : "image/x-cmu-raster",
"ext" : [
"ras"
]
},
{
"mime" : "image/x-rgb",
"ext" : [
"rgb"
]
},
{
"mime" : "application/vnd.rn-realmedia",
"ext" : [
"rm"
]
},
{
"mime" : "application/x-troff",
"ext" : [
"roff",
"t",
"tr"
]
},
{
"mime" : "audio/x-pn-realaudio-plugin",
"ext" : [
"rpm"
]
},
{
"type" : "Document",
"name" : "Microsoft Rich Text Format Document",
"mime" : "text/richtext",
"ext" : "rtf"
},
{
"mime" : "text/sgml",
"ext" : [
"sgm",
"sgml"
]
},
{
"mime" : "application/x-shar",
"ext" : [
"shar"
]
},
{
"mime" : "application/x-stuffit",
"ext" : [
"sit"
]
},
{
"type" : "Drawing",
"name" : "SketchUp Drawing",
"mime" : "application/vnd.sketchup.skp",
"ext" : "skp"
},
{
"mime" : "application/smil",
"ext" : [
"smi",
"smil"
]
},
{
"mime" : "application/x-sharedlib",
"ext" : [
"so"
]
},
{
"mime" : "application/x-futuresplash",
"ext" : [
"spl"
]
},
{
"type" : "Script",
"name" : "SQL Script",
"mime" : "text/plain",
"ext" : "sql"
},
{
"mime" : "application/x-wais-source",
"ext" : [
"src"
]
},
{
"mime" : "application/vnd.sun.xml.calc.template",
"ext" : [
"stc"
]
},
{
"mime" : "application/vnd.sun.xml.draw.template",
"ext" : [
"std"
]
},
{
"mime" : "application/vnd.sun.xml.impress.template",
"ext" : [
"sti"
]
},
{
"mime" : "application/vnd.sun.xml.writer.template",
"ext" : [
"stw"
]
},
{
"mime" : "application/x-sv4cpio",
"ext" : [
"sv4cpio"
]
},
{
"mime" : "application/x-sv4crc",
"ext" : [
"sv4crc"
]
},
{
"type" : "Video",
"name" : "ShockWave Flash",
"mime" : "application/x-shockwave-flash",
"ext" : "swf"
},
{
"mime" : "application/vnd.sun.xml.calc",
"ext" : [
"sxc"
]
},
{
"mime" : "application/vnd.sun.xml.draw",
"ext" : [
"sxd"
]
},
{
"mime" : "application/vnd.sun.xml.writer.global",
"ext" : [
"sxg"
]
},
{
"mime" : "application/vnd.sun.xml.impress",
"ext" : [
"sxi"
]
},
{
"mime" : "application/vnd.sun.xml.math",
"ext" : [
"sxm"
]
},
{
"mime" : "application/vnd.sun.xml.writer",
"ext" : [
"sxw"
]
},
{
"type" : "Archive",
"name" : "Tape Archive",
"mime" : "application/x-tar",
"ext" : "tar"
},
{
"mime" : "application/x-tcl",
"ext" : [
"tcl"
]
},
{
"mime" : "application/x-latex",
"ext" : [
"tex"
]
},
{
"mime" : "application/x-texinfo",
"ext" : [
"texi",
"texinfo"
]
},
{
"type" : "Image",
"name" : "Tagged Image File Format",
"mime" : "image/tiff",
"ext" : [
"tif",
"tiff"
]
},
{
"type" : "Metadata",
"name" : "BitTorrent Meta File",
"mime" : "application/x-bittorrent",
"ext" : "torrent"
},
{
"mime" : "text/tab-separated-values",
"ext" : [
"tsv"
]
},
{
"mime" : "application/x-ustar",
"ext" : [
"ustar"
]
},
{
"mime" : "application/x-cdlink",
"ext" : [
"vcd"
]
},
{
"type" : "Document",
"name" : "vCard",
"mime" : "text/x-vcard",
"ext" : "vcf"
},
{
"mime" : "model/vrml",
"ext" : [
"vrml",
"wrl"
]
},
{
"type" : "Document",
"name" : "Microsoft Visio",
"mime" : "application/vnd.visio",
"ext" : "vsd"
},
{
"type" : "Data",
"name" : "Microsoft Windows Address Book",
"mime" : "application/octet-stream",
"ext" : "wab"
},
{
"type" : "Audio",
"name" : "Waveform Audio File",
"mime" : "audio/x-wav",
"ext" : "wav"
},
{
"type" : "Video",
"name" : "Microsoft Windows Media Video",
"mime" : "video/x-ms-wmv",
"ext" : "wmv"
},
{
"mime" : "image/x-xbitmap",
"ext" : [
"xbm"
]
},
{
"type" : "Document",
"name" : "Microsoft Excel Spreadsheet",
"mime" : "application/vnd.ms-excel",
"ext" : [
"xla",
"xls",
"xlt"
]
},
{
"mime" : "application/vnd.ms-excel.addin.macroEnabled.12",
"ext" : [
"xlam"
]
},
{
"mime" : "application/vnd.ms-excel.sheet.binary.macroEnabled.12",
"ext" : [
"xlsb"
]
},
{
"type" : "Document",
"name" : "Microsoft Excel Spreadsheet with macros",
"mime" : "application/vnd.ms-excel.sheet.macroEnabled.12",
"ext" : "xlsm"
},
{
"type" : "Document",
"name" : "Microsoft Office Open XML Format Spreadsheet",
"mime" : "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"ext" : "xlsx"
},
{
"mime" : "application/vnd.ms-excel.template.macroEnabled.12",
"ext" : [
"xltm"
]
},
{
"type" : "Document",
"name" : "Microsoft Office Open XML Format Spreadsheet Template",
"mime" : "application/vnd.openxmlformats-officedocument.spreadsheetml.template",
"ext" : "xltx"
},
{
"type" : "Document",
"name" : "Extensible Markup Language Document",
"mime" : "text/xml",
"ext" : "xml"
},
{
"mime" : "application/x-xpinstall",
"ext" : [
"xpi"
]
},
{
"mime" : "image/x-xpixmap",
"ext" : [
"xpm"
]
},
{
"type" : "Document",
"name" : "Microsoft XML Paper Specification",
"mime" : "application/vnd.ms-xpsdocument",
"ext" : "xps"
},
{
"mime" : "image/x-xwindowdump",
"ext" : [
"xwd"
]
}
]