{"id":92274,"date":"2025-11-24T11:05:28","date_gmt":"2025-11-24T04:05:28","guid":{"rendered":"https:\/\/itviec.com\/blog\/?p=92274"},"modified":"2025-11-24T11:05:32","modified_gmt":"2025-11-24T04:05:32","slug":"huong-dan-su-dung-mongodb-compass","status":"publish","type":"post","link":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/","title":{"rendered":"MongoDB compass: C\u00e1ch s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 tr\u1ef1c quan qu\u1ea3n l\u00fd CSDL"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">N\u1ed9i dung b\u00e0i vi\u1ebft<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#Tong_quan_ve_MongoDB_compass\" >T\u1ed5ng quan v\u1ec1 MongoDB compass&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#Huong_dan_tai_va_cai_dat_MongoDB_Compass\" >H\u01b0\u1edbng d\u1eabn t\u1ea3i v\u00e0 c\u00e0i \u0111\u1eb7t MongoDB Compass<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#Cac_thao_tac_co_ban_voi_MongoDB_Compass\" >C\u00e1c thao t\u00e1c c\u01a1 b\u1ea3n v\u1edbi MongoDB Compass<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#Cau_hoi_thuong_gap_ve_MongoDB_Compass\" >C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 MongoDB Compass<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#Tong_ket\" >T\u1ed5ng k\u1ebft<\/a><\/li><\/ul><\/nav><\/div>\n\n<p><strong><em>MongoDB l\u00e0 m\u1ed9t trong nh\u1eefng c\u01a1 s\u1edf d\u1eef li\u1ec7u NoSQL ph\u1ed5 bi\u1ebfn nh\u1ea5t hi\u1ec7n nay. Tuy nhi\u00ean, vi\u1ec7c thao t\u00e1c tr\u1ef1c ti\u1ebfp b\u1eb1ng d\u00f2ng l\u1ec7nh (Shell) \u0111\u00f4i khi g\u00e2y kh\u00f3 kh\u0103n, \u0111\u1eb7c bi\u1ec7t v\u1edbi ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u. \u0110\u00f3 l\u00e0 l\u00fac b\u1ea1n c\u1ea7n \u0111\u1ebfn MongoDB Compass \u2013 c\u00f4ng c\u1ee5 giao di\u1ec7n \u0111\u1ed3 h\u1ecda (GUI) ch\u00ednh th\u1ee9c do MongoDB ph\u00e1t tri\u1ec3n, cho ph\u00e9p ng\u01b0\u1eddi d\u00f9ng s\u1eed d\u1ee5ng v\u00e0 t\u01b0\u01a1ng t\u00e1c v\u1edbi MongoDB d\u1ec5 d\u00e0ng h\u01a1n.<\/em><\/strong><\/p>\n\n\n\n<p>\u0110\u1ecdc b\u00e0i vi\u1ebft n\u00e0y \u0111\u1ec3 hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>MongoDB Compass l\u00e0 g\u00ec v\u00e0 v\u00ec sao n\u00ean d\u00f9ng thay cho Shell<\/li>\n\n\n\n<li>C\u00e1ch c\u00e0i \u0111\u1eb7t Mongodb Compass \u0111\u00fang phi\u00ean b\u1ea3n ph\u00f9 h\u1ee3p<\/li>\n\n\n\n<li>C\u00e1c thao t\u00e1c c\u01a1 b\u1ea3n v\u1edbi Compass<\/li>\n\n\n\n<li>C\u00e1c t\u00f9y ch\u1ecdn n\u00e2ng c\u1ea1o khi t\u1ea1o collection\/ index<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-t\u1ed5ng-quan-v\u1ec1-mongodb-compass-nbsp\"><span class=\"ez-toc-section\" id=\"Tong_quan_ve_MongoDB_compass\"><\/span><strong>T\u1ed5ng quan v\u1ec1 MongoDB compass&nbsp;<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>MongoDB l\u00e0 h\u1ec7 qu\u1ea3n tr\u1ecb c\u01a1 s\u1edf d\u1eef li\u1ec7u NoSQL d\u1ea1ng document. Thay v\u00ec l\u01b0u d\u1eef li\u1ec7u theo b\u1ea3ng v\u00e0 d\u00f2ng nh\u01b0 SQL, MongoDB l\u01b0u d\u1eef li\u1ec7u d\u01b0\u1edbi d\u1ea1ng document (t\u00e0i li\u1ec7u) v\u1edbi c\u1ea5u tr\u00fac linh ho\u1ea1t, th\u01b0\u1eddng \u0111\u01b0\u1ee3c bi\u1ec3u di\u1ec5n b\u1eb1ng BSON (Binary JSON). Nh\u1edd \u0111\u00f3, MongoDB r\u1ea5t ph\u00f9 h\u1ee3p cho c\u00e1c \u1ee9ng d\u1ee5ng hi\u1ec7n \u0111\u1ea1i c\u1ea7n kh\u1ea3 n\u0103ng m\u1edf r\u1ed9ng nhanh v\u00e0 x\u1eed l\u00fd d\u1eef li\u1ec7u phi c\u1ea5u tr\u00fac ho\u1eb7c b\u00e1n c\u1ea5u tr\u00fac.<\/p>\n\n\n\n<p>MongoDB Compass l\u00e0 m\u1ed9t c\u00f4ng c\u1ee5 c\u00f3 giao di\u1ec7n tr\u1ef1c quan (GUI \u2013 Graphical User Interface) ch\u00ednh th\u1ee9c do MongoDB Inc. ph\u00e1t tri\u1ec3n gi\u00fap ng\u01b0\u1eddi d\u00f9ng l\u00e0m vi\u1ec7c v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u MongoDB m\u1ed9t c\u00e1ch d\u1ec5 d\u00e0ng. N\u1ebfu nh\u01b0 tr\u01b0\u1edbc \u0111\u00e2y ta ph\u1ea3i g\u00f5 l\u1ec7nh trong c\u1eeda s\u1ed5 d\u00f2ng l\u1ec7nh (Shell) \u0111\u1ec3 th\u00eam, s\u1eeda, x\u00f3a ho\u1eb7c truy v\u1ea5n d\u1eef li\u1ec7u, th\u00ec v\u1edbi Compass t\u1ea5t c\u1ea3 c\u00e1c thao t\u00e1c \u0111\u00f3 \u0111\u1ec1u c\u00f3 th\u1ec3 th\u1ef1c hi\u1ec7n b\u1eb1ng v\u00e0i c\u00fa nh\u1ea5p chu\u1ed9t.<\/p>\n\n\n\n<p>Compass hi\u1ec3n th\u1ecb d\u1eef li\u1ec7u d\u01b0\u1edbi d\u1ea1ng\u00a0<strong>b\u1ea3ng, bi\u1ec3u \u0111\u1ed3\u00a0<\/strong>v\u00e0 cho ph\u00e9p quan s\u00e1t c\u1ea5u tr\u00fac t\u00e0i li\u1ec7u (document) m\u00e0 kh\u00f4ng c\u1ea7n ph\u1ea3i nh\u1edb ch\u00ednh x\u00e1c c\u00fa ph\u00e1p l\u1ec7nh, gi\u00fap ti\u1ebft ki\u1ec7m th\u1eddi gian v\u00e0 gi\u1ea3m l\u1ed7i khi l\u00e0m vi\u1ec7c, \u0111\u1eb7c bi\u1ec7t h\u1eefu \u00edch cho nh\u1eefng ai m\u1edbi l\u00e0m quen v\u1edbi <a href=\"https:\/\/itviec.com\/blog\/mongodb-la-gi\/\" target=\"_blank\" rel=\"noreferrer noopener\">MongoDB<\/a>.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><em>\u0110\u1ecdc chi ti\u1ebft: <a href=\"https:\/\/itviec.com\/blog\/lo-trinh-hoc-tap-mongodb-tutorial\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>MongoDB tutorial c\u01a1 b\u1ea3n: H\u01b0\u1edbng d\u1eabn c\u00e1c b\u01b0\u1edbc h\u1ecdc MongoDB to\u00e0n di\u1ec7n<\/strong><\/a><\/em><\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-vi-sao-nen-s\u1eed-d\u1ee5ng-compass-thay-vi-shell\"><strong>V\u00ec sao n\u00ean s\u1eed d\u1ee5ng Compass thay v\u00ec Shell?<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>D\u1ec5 s\u1eed d\u1ee5ng h\u01a1n cho ng\u01b0\u1eddi m\u1edbi<\/strong>: Shell y\u00eau c\u1ea7u ng\u01b0\u1eddi d\u00f9ng ph\u1ea3i nh\u1edb c\u00fa ph\u00e1p ch\u00ednh x\u00e1c, trong khi Compass cung c\u1ea5p giao di\u1ec7n tr\u1ef1c quan, hi\u1ec3n th\u1ecb d\u1eef li\u1ec7u d\u01b0\u1edbi d\u1ea1ng b\u1ea3ng v\u00e0 bi\u1ec3u \u0111\u1ed3 n\u00ean ng\u01b0\u1eddi d\u00f9ng c\u00f3 th\u1ec3 quan s\u00e1t v\u00e0 thao t\u00e1c tr\u1ef1c ti\u1ebfp v\u1edbi d\u1eef li\u1ec7u thay v\u00ec ph\u1ea3i g\u00f5 l\u1ec7nh th\u1ee7 c\u00f4ng.<\/li>\n\n\n\n<li><strong>Gi\u1ea3m sai s\u00f3t<\/strong>: Khi l\u00e0m vi\u1ec7c b\u1eb1ng Shell, ch\u1ec9 c\u1ea7n sai m\u1ed9t k\u00fd t\u1ef1 l\u00e0 l\u1ec7nh kh\u00f4ng ch\u1ea1y. V\u1edbi Compass, m\u1ecdi thao t\u00e1c \u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3 qua giao di\u1ec7n n\u00ean ng\u01b0\u1eddi d\u00f9ng s\u1ebd \u00edt g\u1eb7p l\u1ed7i h\u01a1n.<\/li>\n\n\n\n<li><strong>Kh\u00e1m ph\u00e1 v\u00e0 ph\u00e2n t\u00edch d\u1eef li\u1ec7u d\u1ec5 d\u00e0ng<\/strong>: Tab Schema trong Compass cho ph\u00e9p t\u1ef1 \u0111\u1ed9ng ph\u00e2n t\u00edch d\u1eef li\u1ec7u, hi\u1ec3n th\u1ecb lo\u1ea1i d\u1eef li\u1ec7u, t\u1ea7n su\u1ea5t xu\u1ea5t hi\u1ec7n v\u00e0 nh\u1eefng b\u1ea5t th\u01b0\u1eddng. \u0110\u00e2y l\u00e0 t\u00ednh n\u0103ng \u0111\u1eb7c bi\u1ec7t h\u1eefu \u00edch khi l\u00e0m vi\u1ec7c v\u1edbi b\u1ed9 d\u1eef li\u1ec7u l\u1edbn ho\u1eb7c ch\u01b0a c\u00f3 c\u1ea5u tr\u00fac r\u00f5 r\u00e0ng.<\/li>\n\n\n\n<li><strong>X\u00e2y d\u1ef1ng pipeline t\u1eebng b\u01b0\u1edbc<\/strong>: V\u1edbi Compass, ng\u01b0\u1eddi d\u00f9ng c\u00f3 th\u1ec3 t\u1ea1o v\u00e0 ki\u1ec3m th\u1eed aggregation pipeline theo t\u1eebng giai \u0111o\u1ea1n, quan s\u00e1t k\u1ebft qu\u1ea3 ngay l\u1eadp t\u1ee9c, gi\u00fap ti\u1ebft ki\u1ec7m th\u1eddi gian so v\u1edbi vi\u1ec7c vi\u1ebft v\u00e0 s\u1eeda l\u1ed7i c\u00e1c c\u00e2u l\u1ec7nh d\u00e0i trong Shell.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-cac-tinh-nang-n\u1ed5i-b\u1eadt-c\u1ee7a-compass\"><strong>C\u00e1c t\u00ednh n\u0103ng n\u1ed5i b\u1eadt c\u1ee7a Compass<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Tr\u1ef1c quan h\u00f3a d\u1eef li\u1ec7u (Data Visualization):<\/strong>&nbsp;Compass cung c\u1ea5p giao di\u1ec7n th\u00e2n thi\u1ec7n \u0111\u1ec3 duy\u1ec7t qua c\u01a1 s\u1edf d\u1eef li\u1ec7u, collection v\u00e0 document gi\u00fap ng\u01b0\u1eddi d\u00f9ng d\u1ec5 d\u00e0ng l\u1ecdc, s\u1eafp x\u1ebfp v\u00e0 ph\u00e2n t\u00edch d\u1eef li\u1ec7u m\u00e0 kh\u00f4ng c\u1ea7n vi\u1ebft l\u1ec7nh ph\u1ee9c t\u1ea1p. Compass c\u00f2n h\u1ed7 tr\u1ee3 nhi\u1ec1u ch\u1ebf \u0111\u1ed9 hi\u1ec3n th\u1ecb linh ho\u1ea1t nh\u01b0 List View, Table View v\u00e0 JSON View, gi\u00fap vi\u1ec7c quan s\u00e1t v\u00e0 ph\u00e2n t\u00edch d\u1eef li\u1ec7u tr\u1edf n\u00ean tr\u1ef1c quan v\u00e0 hi\u1ec7u qu\u1ea3 h\u01a1n.<\/li>\n\n\n\n<li><strong>Tr\u00ecnh x\u00e2y d\u1ef1ng truy v\u1ea5n tr\u1ef1c quan (Visual Query Builder):&nbsp;<\/strong>Thay v\u00ec ph\u1ea3i nh\u1edb c\u00fa ph\u00e1p, ng\u01b0\u1eddi c\u00f3 th\u1ec3 d\u00f9ng ch\u1ee9c n\u0103ng k\u00e9o-th\u1ea3 \u0111\u1ec3 x\u00e2y d\u1ef1ng truy v\u1ea5n. Compass hi\u1ec3n th\u1ecb k\u1ebft qu\u1ea3 ngay l\u1eadp t\u1ee9c, gi\u00fap qu\u00e1 tr\u00ecnh t\u00ecm ki\u1ebfm th\u00f4ng tin nhanh ch\u00f3ng v\u00e0 ch\u00ednh x\u00e1c h\u01a1n.<\/li>\n\n\n\n<li><strong>Ph\u00e2n t\u00edch l\u01b0\u1ee3c \u0111\u1ed3 (Schema Analysis):<\/strong>&nbsp;Compass t\u1ef1 \u0111\u1ed9ng qu\u00e9t d\u1eef li\u1ec7u v\u00e0 \u0111\u01b0a ra c\u00e1i nh\u00ecn to\u00e0n c\u1ea3nh v\u1ec1 c\u1ea5u tr\u00fac: c\u00e1c field, ki\u1ec3u d\u1eef li\u1ec7u, t\u1ea7n su\u1ea5t xu\u1ea5t hi\u1ec7n v\u00e0 b\u1ea5t th\u01b0\u1eddng. \u0110\u00e2y l\u00e0 c\u00f4ng c\u1ee5 c\u1ef1c k\u1ef3 h\u1eefu \u00edch khi l\u00e0m vi\u1ec7c v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u c\u00f3 c\u1ea5u tr\u00fac linh ho\u1ea1t (schema-less) nh\u01b0 MongoDB.<\/li>\n\n\n\n<li><strong>X\u00e2y d\u1ef1ng Aggregation Pipeline:<\/strong>&nbsp;Aggregation l\u00e0 \u201c\u0111i\u1ec3m m\u1ea1nh\u201d c\u1ee7a MongoDB, nh\u01b0ng c\u00fa ph\u00e1p th\u01b0\u1eddng ph\u1ee9c t\u1ea1p. Compass gi\u1ea3i quy\u1ebft b\u1eb1ng c\u00e1ch cung c\u1ea5p giao di\u1ec7n tr\u1ef1c quan, gi\u00fap ng\u01b0\u1eddi d\u00f9ng x\u00e2y d\u1ef1ng pipeline t\u1eebng b\u01b0\u1edbc \u0111\u01b0\u1ee3c h\u1ed7 tr\u1ee3 g\u1ee3i \u00fd c\u00fa ph\u00e1p (autocomplete) v\u00e0 xem k\u1ebft qu\u1ea3 theo th\u1eddi gian th\u1ef1c.<\/li>\n\n\n\n<li><strong>Qu\u1ea3n l\u00fd ch\u1ec9 m\u1ee5c (Index Management):<\/strong>&nbsp;T\u1ed1i \u01b0u h\u00f3a hi\u1ec7u su\u1ea5t d\u1ec5 d\u00e0ng h\u01a1n v\u1edbi kh\u1ea3 n\u0103ng t\u1ea1o, ch\u1ec9nh s\u1eeda v\u00e0 theo d\u00f5i hi\u1ec7u qu\u1ea3 c\u1ee7a index tr\u1ef1c ti\u1ebfp trong Compass. Ng\u01b0\u1eddi d\u00f9ng c\u0169ng c\u00f3 th\u1ec3 xem c\u00e1c ch\u1ec9 s\u1ed1 hi\u1ec7u n\u0103ng c\u1ee7a index nh\u01b0 s\u1ed1 l\u1ea7n s\u1eed d\u1ee5ng v\u00e0 k\u00edch th\u01b0\u1edbc, r\u1ed3i t\u1eeb \u0111\u00f3 \u0111\u01b0a ra \u0111\u00e1nh gi\u00e1 v\u00e0 tinh ch\u1ec9nh chi\u1ebfn l\u01b0\u1ee3c l\u1eadp ch\u1ec9 m\u1ee5c \u0111\u1ec3 \u0111\u1ea1t hi\u1ec7u qu\u1ea3 t\u1ed1i \u01b0u cho c\u01a1 s\u1edf d\u1eef li\u1ec7u.<\/li>\n\n\n\n<li><strong>Gi\u00e1m s\u00e1t hi\u1ec7u n\u0103ng (Performance Monitoring):<\/strong>&nbsp;Compass hi\u1ec3n th\u1ecb s\u1ed1 li\u1ec7u nh\u01b0 t\u1ed1c \u0111\u1ed9 truy v\u1ea5n, m\u1ee9c s\u1eed d\u1ee5ng index hay c\u1ea3nh b\u00e1o v\u1ec1 c\u00e1c truy v\u1ea5n kh\u00f4ng \u0111\u01b0\u1ee3c t\u1ed1i \u01b0u, gi\u00fap ng\u01b0\u1eddi d\u00f9ng c\u1ea3i thi\u1ec7n hi\u1ec7u su\u1ea5t c\u01a1 s\u1edf d\u1eef li\u1ec7u. Tuy nhi\u00ean, \u0111\u1ec3 gi\u00e1m s\u00e1t to\u00e0n di\u1ec7n h\u01a1n, ng\u01b0\u1eddi d\u00f9ng n\u00ean k\u1ebft h\u1ee3p v\u1edbi MongoDB Atlas ho\u1eb7c c\u00e1c c\u00f4ng c\u1ee5 monitoring chuy\u00ean d\u1ee5ng kh\u00e1c.<\/li>\n\n\n\n<li><strong>B\u1ea3o m\u1eadt k\u1ebft n\u1ed1i (Secure Connection):<\/strong>&nbsp;Compass h\u1ed7 tr\u1ee3 c\u00e1c c\u01a1 ch\u1ebf b\u1ea3o m\u1eadt nh\u01b0 SSL\/TLS v\u00e0 x\u00e1c th\u1ef1c ng\u01b0\u1eddi d\u00f9ng (SCRAM, X.509, LDAP, Kerberos), \u0111\u1ea3m b\u1ea3o vi\u1ec7c k\u1ebft n\u1ed1i v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u an to\u00e0n trong m\u1ecdi m\u00f4i tr\u01b0\u1eddng.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-h\u01b0\u1edbng-d\u1eabn-t\u1ea3i-va-cai-d\u1eb7t-mongodb-compass\"><span class=\"ez-toc-section\" id=\"Huong_dan_tai_va_cai_dat_MongoDB_Compass\"><\/span><strong>H\u01b0\u1edbng d\u1eabn t\u1ea3i v\u00e0 c\u00e0i \u0111\u1eb7t MongoDB Compass<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-yeu-c\u1ea7u-h\u1ec7-th\u1ed1ng-t\u1ed1i-thi\u1ec3u\"><strong>Y\u00eau c\u1ea7u h\u1ec7 th\u1ed1ng t\u1ed1i thi\u1ec3u<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Windows: Windows 10 tr\u1edf l\u00ean (64-bit)<\/li>\n\n\n\n<li>macOS: macOS 10.12 tr\u1edf l\u00ean<\/li>\n\n\n\n<li>Linux: Ubuntu 18.04+, RHEL\/CentOS 7+ ho\u1eb7c c\u00e1c distro t\u01b0\u01a1ng \u0111\u01b0\u01a1ng<\/li>\n\n\n\n<li>RAM: T\u1ed1i thi\u1ec3u 2GB (khuy\u1ebfn ngh\u1ecb 4GB tr\u1edf l\u00ean)<\/li>\n\n\n\n<li>Dung l\u01b0\u1ee3ng: Kho\u1ea3ng 200-300MB cho \u1ee9ng d\u1ee5ng<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-b\u01b0\u1edbc-1-nbsp\"><strong>B\u01b0\u1edbc 1:&nbsp;<\/strong><\/h3>\n\n\n\n<p>Truy c\u1eadp trang web ch\u00ednh th\u1ee9c c\u1ee7a MongoDB&nbsp;<a href=\"https:\/\/www.mongodb.com\/try\/download\/compass\" target=\"_blank\" rel=\"noreferrer noopener\">t\u1ea1i \u0111\u00e2y<\/a>&nbsp;\u0111\u1ec3 t\u1ea3i v\u1ec1 phi\u00ean b\u1ea3n ph\u00f9 h\u1ee3p v\u1edbi h\u1ec7 \u0111i\u1ec1u h\u00e0nh c\u1ee7a b\u1ea1n.<\/p>\n\n\n\n<p><strong>C\u00e1c phi\u00ean b\u1ea3n MongoDB Compass:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Phi\u00ean b\u1ea3n<\/strong><\/td><td><strong>M\u00f4 t\u1ea3&nbsp;<\/strong><\/td><td><strong>\u1ee8ng d\u1ee5ng<\/strong><\/td><td><strong>\u01afu \u0111i\u1ec3m<\/strong><\/td><\/tr><tr><td><strong>Compass Community<\/strong><\/td><td>L\u00e0 phi\u00ean b\u1ea3n mi\u1ec5n ph\u00ed, cung c\u1ea5p c\u00e1c t\u00ednh n\u0103ng c\u01a1 b\u1ea3n nh\u01b0 xem v\u00e0 thao t\u00e1c d\u1eef li\u1ec7u (CRUD), ch\u1ea1y truy v\u1ea5n, qu\u1ea3n l\u00fd index, xem c\u1ea5u tr\u00fac schema.<\/td><td>Ph\u00f9 h\u1ee3p v\u1edbi m\u1ee5c \u0111\u00edch h\u1ecdc t\u1eadp, d\u1ef1 \u00e1n c\u00e1 nh\u00e2n ho\u1eb7c m\u00f4i tr\u01b0\u1eddng ph\u00e1t tri\u1ec3n nh\u1ecf.<\/td><td>D\u1ec5 ti\u1ebfp c\u1eadn, kh\u00f4ng y\u00eau c\u1ea7u chi ph\u00ed, \u0111\u1ee7 t\u00ednh n\u0103ng \u0111\u1ec3 l\u00e0m quen v\u1edbi GUI c\u1ee7a MongoDB.<\/td><\/tr><tr><td><strong>Compass Enterprise<\/strong><\/td><td>Phi\u00ean b\u1ea3n cao c\u1ea5p, h\u1ed7 tr\u1ee3 c\u00e1c t\u00ednh n\u0103ng n\u00e2ng cao nh\u01b0 ph\u00e2n t\u00edch schema chuy\u00ean s\u00e2u, gi\u00e1m s\u00e1t hi\u1ec7u n\u0103ng, x\u00e1c th\u1ef1c v\u00e0 b\u1ea3o m\u1eadt m\u1ea1nh h\u01a1n, h\u1ed7 tr\u1ee3 LDAP\/Kerberos.<\/td><td>D\u00e0nh cho m\u00f4i tr\u01b0\u1eddng doanh nghi\u1ec7p ho\u1eb7c khi c\u1ea7n c\u00e1c t\u00ednh n\u0103ng gi\u00e1m s\u00e1t v\u00e0 b\u1ea3o m\u1eadt m\u1edf r\u1ed9ng.<\/td><td>Gi\u00fap qu\u1ea3n tr\u1ecb vi\u00ean theo d\u00f5i ho\u1ea1t \u0111\u1ed9ng, t\u1ed1i \u01b0u hi\u1ec7u su\u1ea5t, v\u00e0 ki\u1ec3m so\u00e1t truy c\u1eadp an to\u00e0n h\u01a1n.<\/td><\/tr><tr><td><strong>Compass Read-Only \/ Enterprise Read-Only<\/strong><\/td><td>Phi\u00ean b\u1ea3n ch\u1ec9 \u0111\u1ecdc, kh\u00f4ng cho ph\u00e9p ch\u1ec9nh s\u1eeda hay x\u00f3a d\u1eef li\u1ec7u. Ng\u01b0\u1eddi d\u00f9ng ch\u1ec9 c\u00f3 th\u1ec3 xem v\u00e0 truy v\u1ea5n.<\/td><td>D\u00e0nh cho ng\u01b0\u1eddi xem b\u00e1o c\u00e1o, nh\u00e2n vi\u00ean ph\u00e2n t\u00edch ho\u1eb7c m\u00f4i tr\u01b0\u1eddng y\u00eau c\u1ea7u ki\u1ec3m so\u00e1t nghi\u00eam ng\u1eb7t quy\u1ec1n ghi.<\/td><td>Gi\u1ea3m r\u1ee7i ro thao t\u00e1c sai, t\u0103ng t\u00ednh an to\u00e0n d\u1eef li\u1ec7u.<\/td><\/tr><tr><td><strong>Compass Isolated Edition<\/strong><\/td><td>Phi\u00ean b\u1ea3n c\u00f4 l\u1eadp m\u1ea1ng, ch\u1ec9 cho ph\u00e9p k\u1ebft n\u1ed1i \u0111\u1ebfn server MongoDB \u0111\u01b0\u1ee3c ch\u1ec9 \u0111\u1ecbnh. Ch\u1eb7n m\u1ecdi k\u1ebft n\u1ed1i Internet b\u00ean ngo\u00e0i, kh\u00f4ng h\u1ed7 tr\u1ee3 c\u1eadp nh\u1eadt t\u1ef1 \u0111\u1ed9ng ho\u1eb7c g\u1eedi b\u00e1o c\u00e1o l\u1ed7i.<\/td><td>D\u00e0nh cho h\u1ec7 th\u1ed1ng b\u1ea3o m\u1eadt cao, m\u00f4i tr\u01b0\u1eddng kh\u00f4ng c\u00f3 Internet, ho\u1eb7c t\u1ed5 ch\u1ee9c c\u1ea7n tu\u00e2n th\u1ee7 ch\u00ednh s\u00e1ch m\u1ea1ng nghi\u00eam ng\u1eb7t.<\/td><td>\u0110\u1ea3m b\u1ea3o t\u00ednh b\u1ea3o m\u1eadt v\u00e0 ki\u1ec3m so\u00e1t tuy\u1ec7t \u0111\u1ed1i, tr\u00e1nh r\u00f2 r\u1ec9 d\u1eef li\u1ec7u ho\u1eb7c truy c\u1eadp m\u1ea1ng ngo\u00e0i \u00fd mu\u1ed1n.<\/td><\/tr><tr><td><strong>Phi\u00ean b\u1ea3n Beta \/ Nightly Builds<\/strong><\/td><td>C\u00e1c b\u1ea3n th\u1eed nghi\u1ec7m v\u1edbi t\u00ednh n\u0103ng m\u1edbi ho\u1eb7c b\u1ea3n s\u1eeda l\u1ed7i s\u1edbm, \u0111\u01b0\u1ee3c ph\u00e1t h\u00e0nh \u0111\u1ecbnh k\u1ef3 qua GitHub ho\u1eb7c trang t\u1ea3i ch\u00ednh th\u1ee9c.<\/td><td>Khi mu\u1ed1n th\u1eed nghi\u1ec7m t\u00ednh n\u0103ng m\u1edbi, \u0111\u00f3ng g\u00f3p ph\u1ea3n h\u1ed3i cho nh\u00f3m ph\u00e1t tri\u1ec3n MongoDB.<\/td><td>Gi\u00fap c\u1ed9ng \u0111\u1ed3ng ng\u01b0\u1eddi d\u00f9ng tr\u1ea3i nghi\u1ec7m s\u1edbm, ki\u1ec3m th\u1eed v\u00e0 h\u1ed7 tr\u1ee3 c\u1ea3i thi\u1ec7n s\u1ea3n ph\u1ea9m.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-b\u01b0\u1edbc-2-ch\u1ecdn-h\u1ec7-di\u1ec1u-hanh-va-goi-cai-d\u1eb7t\"><strong>B\u01b0\u1edbc 2: Ch\u1ecdn h\u1ec7 \u0111i\u1ec1u h\u00e0nh v\u00e0 g\u00f3i c\u00e0i \u0111\u1eb7t<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Windows<\/strong>: ch\u1ecdn g\u00f3i&nbsp;<code>.msi<\/code>&nbsp;(installer chu\u1ea9n) ho\u1eb7c&nbsp;<code>.zip<\/code>&nbsp;n\u1ebfu mu\u1ed1n ch\u1ea1y portable kh\u00f4ng c\u1ea7n c\u00e0i \u0111\u1eb7t.<\/li>\n\n\n\n<li><strong>macOS<\/strong>: ch\u1ecdn g\u00f3i&nbsp;<code>.dmg<\/code>&nbsp;(d\u1ea1ng c\u00e0i \u0111\u1eb7t th\u00f4ng d\u1ee5ng) ho\u1eb7c&nbsp;<code>.zip<\/code>.<\/li>\n\n\n\n<li><strong>Linux<\/strong>: ch\u1ecdn b\u1ea3n&nbsp;<code>.deb<\/code>&nbsp;(cho Ubuntu\/Debian) ho\u1eb7c&nbsp;<code>.rpm<\/code>&nbsp;(cho CentOS\/RedHat) ho\u1eb7c&nbsp;<code>.tar.gz&nbsp;<\/code>(phi\u00ean b\u1ea3n generic cho c\u00e1c distro kh\u00e1c).<\/li>\n<\/ul>\n\n\n\n<p><em>L\u01b0u \u00fd: N\u00ean ch\u1ecdn phi\u00ean b\u1ea3n Stable \u0111\u1ec3 tr\u00e1nh l\u1ed7i v\u00e0 \u0111\u1ea3m b\u1ea3o t\u01b0\u01a1ng th\u00edch v\u1edbi MongoDB server.<\/em><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-b\u01b0\u1edbc-3-cai-d\u1eb7t\"><strong>B\u01b0\u1edbc 3: C\u00e0i \u0111\u1eb7t<\/strong><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-windows\"><strong>Windows<\/strong><\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>M\u1edf file&nbsp;<code>.msi<\/code>&nbsp;&gt;&gt; ch\u1ecdn&nbsp;<strong>Next&nbsp;<\/strong>&gt;&gt;&nbsp;<strong>I Agree<\/strong>&nbsp;v\u1edbi \u0111i\u1ec1u kho\u1ea3n.<\/li>\n\n\n\n<li>Ch\u1ecdn&nbsp;<strong>Install for all users<\/strong>&nbsp;(n\u1ebfu mu\u1ed1n m\u1ecdi t\u00e0i kho\u1ea3n trong m\u00e1y \u0111\u1ec1u d\u00f9ng \u0111\u01b0\u1ee3c) ho\u1eb7c&nbsp;<strong>Install for current user<\/strong>.<\/li>\n\n\n\n<li>Nh\u1ea5n&nbsp;<strong>Install<\/strong>&nbsp;&gt;&gt; ch\u1edd qu\u00e1 tr\u00ecnh c\u00e0i \u0111\u1eb7t ho\u00e0n t\u1ea5t &gt;&gt;&nbsp;<strong>Finish<\/strong>.<\/li>\n\n\n\n<li>C\u00f3 th\u1ec3 b\u1ecf ch\u1ecdn&nbsp;<strong>Launch MongoDB Compass<\/strong>&nbsp;n\u1ebfu ch\u01b0a mu\u1ed1n m\u1edf ngay.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-macos\"><strong>MacOS<\/strong><\/h4>\n\n\n\n<ol class=\"wp-block-list\">\n<li>M\u1edf file&nbsp;<code>.dmg<\/code>&nbsp;v\u1eeba t\u1ea3i.<\/li>\n\n\n\n<li>K\u00e9o bi\u1ec3u t\u01b0\u1ee3ng MongoDB Compass v\u00e0o th\u01b0 m\u1ee5c Applications.<\/li>\n\n\n\n<li>L\u1ea7n \u0111\u1ea7u m\u1edf, macOS c\u00f3 th\u1ec3 c\u1ea3nh b\u00e1o v\u1ec1 \u1ee9ng d\u1ee5ng t\u1eeb developer ch\u01b0a x\u00e1c minh. V\u00e0o&nbsp;<strong>System<\/strong>&nbsp;<strong>Preferences<\/strong>&nbsp;&gt;&gt;&nbsp;<strong>Security &amp; Privacy<\/strong>&nbsp;&gt;&gt; ch\u1ecdn&nbsp;<strong>Open Anyway<\/strong>.<\/li>\n\n\n\n<li>M\u1edf&nbsp;<strong>Launchpad<\/strong>&nbsp;&gt;&gt; t\u00ecm&nbsp;<strong>Compass<\/strong>&nbsp;&gt;&gt; ch\u1ea1y \u1ee9ng d\u1ee5ng.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-linux\"><strong>Linux<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>V\u1edbi\u00a0<code>.deb<\/code>\u00a0(Ubuntu\/Debian):<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo dpkg -i mongodb-compass_x.y.z_amd64.deb\nsudo apt-get install -f<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>V\u1edbi&nbsp;<code>.rpm<\/code>&nbsp;(CentOS\/RedHat\/Fedora):<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo rpm -ivh mongodb-compass-x.y.z.x86_64.rpm\nsudo yum install mongodb-compass-x.y.z.x86_64.rpm<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-b\u01b0\u1edbc-4-ki\u1ec3m-tra-cai-d\u1eb7t-nbsp\"><strong>B\u01b0\u1edbc 4: Ki\u1ec3m tra c\u00e0i \u0111\u1eb7t&nbsp;<\/strong><\/h3>\n\n\n\n<p>M\u1edf MongoDB Compass t\u1eeb menu Start (Windows) ho\u1eb7c Launchpad (macOS). N\u1ebfu giao di\u1ec7n ch\u00ednh v\u1edbi \u00f4 nh\u1eadp connection string (chu\u1ed7i k\u1ebft n\u1ed1i) xu\u1ea5t hi\u1ec7n ngh\u0129a l\u00e0 b\u1ea1n \u0111\u00e3 c\u00e0i th\u00e0nh c\u00f4ng. Phi\u00ean b\u1ea3n Compass \u0111ang s\u1eed d\u1ee5ng s\u1ebd hi\u1ec3n th\u1ecb \u1edf g\u00f3c d\u01b0\u1edbi b\u00ean tr\u00e1i c\u1ee7a c\u1eeda s\u1ed5.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-k\u1ebft-n\u1ed1i-mongodb-compass-v\u1edbi-c\u01a1-s\u1edf-d\u1eef-li\u1ec7u\"><strong>K\u1ebft n\u1ed1i MongoDB Compass v\u1edbi c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>M\u1edf MongoDB Compass<\/strong>: Sau khi c\u00e0i \u0111\u1eb7t, kh\u1edfi \u0111\u1ed9ng Compass. \u1ede m\u00e0n h\u00ecnh ch\u00ednh b\u1ea1n s\u1ebd th\u1ea5y m\u1ed9t \u00f4 nh\u1eadp c\u00f3 t\u00ean&nbsp;<strong>Connection String<\/strong>&nbsp;ho\u1eb7c&nbsp;<strong>New Connection.<\/strong><\/li>\n\n\n\n<li><strong>T\u00ecm v\u00e0 d\u00e1n chu\u1ed7i k\u1ebft n\u1ed1i<\/strong>&nbsp;(Connection String):&nbsp;<\/li>\n<\/ol>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>N\u1ebfu c\u00e0i MongoDB tr\u00ean m\u00e1y t\u00ednh (local)<\/strong>&nbsp;th\u00ec chu\u1ed7i k\u1ebft n\u1ed1i m\u1eb7c \u0111\u1ecbnh th\u01b0\u1eddng l\u00e0:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>mongodb:\/\/localhost:27017\n\/\/ Ho\u1eb7c n\u1ebfu c\u1ea7n x\u00e1c th\u1ef1c\nmongodb:\/\/username:password@localhost:27017<\/code><\/pre>\n\n\n\n<p>Trong \u0111\u00f3&nbsp;<code>localhost<\/code>&nbsp;ngh\u0129a l\u00e0 ch\u1ea1y tr\u00ean ch\u00ednh m\u00e1y b\u1ea1n, c\u00f2n&nbsp;<code>27017<\/code>&nbsp;l\u00e0 c\u1ed5ng m\u1eb7c \u0111\u1ecbnh c\u1ee7a MongoDB.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>N\u1ebfu b\u1ea1n d\u00f9ng MongoDB Atlas (cloud)<\/strong>:\n<ul class=\"wp-block-list\">\n<li>\u0110\u0103ng nh\u1eadp v\u00e0o Atlas&nbsp;<a href=\"https:\/\/www.mongodb.com\/products\/platform\/cloud\" target=\"_blank\" rel=\"noreferrer noopener\">t\u1ea1i \u0111\u00e2y<\/a>.<\/li>\n\n\n\n<li>Ch\u1ecdn cluster mu\u1ed1n k\u1ebft n\u1ed1i &gt;&gt; b\u1ea5m&nbsp;<strong>Connect<\/strong>&nbsp;&gt;&gt; ch\u1ecdn&nbsp;<strong>Connect with MongoDB Compass<\/strong>&nbsp;ho\u1eb7c&nbsp;<strong>Compass<\/strong>.<\/li>\n\n\n\n<li>Copy chu\u1ed7i k\u1ebft n\u1ed1i m\u00e0 Atlas cung c\u1ea5p, c\u00f3 d\u1ea1ng:<br><code>mongodb+srv:\/\/&lt;username&gt;:&lt;password&gt;@&lt;cluster-url&gt;\/test<\/code><\/li>\n\n\n\n<li>Thay &lt;username&gt; v\u00e0 &lt;password&gt; b\u1eb1ng t\u00e0i kho\u1ea3n b\u1ea1n \u0111\u00e3 t\u1ea1o.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li><strong>Nh\u1ea5n Connect<\/strong>: N\u1ebfu m\u1ecdi th\u00f4ng tin ch\u00ednh x\u00e1c, Compass s\u1ebd hi\u1ec3n th\u1ecb danh s\u00e1ch c\u00e1c database hi\u1ec7n c\u00f3.&nbsp;<\/li>\n\n\n\n<li><strong>N\u1ebfu k\u1ebft n\u1ed1i th\u1ea5t b\u1ea1i, h\u00e3y ki\u1ec3m tra l\u1ea1i<\/strong>:\n<ul class=\"wp-block-list\">\n<li>MongoDB server \u0111\u00e3 ch\u1ea1y ch\u01b0a (v\u1edbi local)<\/li>\n\n\n\n<li>Firewall c\u00f3 ch\u1eb7n port 27017 kh\u00f4ng<\/li>\n\n\n\n<li>Username\/password c\u00f3 ch\u00ednh x\u00e1c kh\u00f4ng<\/li>\n\n\n\n<li>Network access \u0111\u00e3 \u0111\u01b0\u1ee3c c\u1ea5u h\u00ecnh \u0111\u00fang ch\u01b0a (v\u1edbi Atlas)<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cac-thao-tac-c\u01a1-b\u1ea3n-v\u1edbi-mongodb-compass\"><span class=\"ez-toc-section\" id=\"Cac_thao_tac_co_ban_voi_MongoDB_Compass\"><\/span><strong>C\u00e1c thao t\u00e1c c\u01a1 b\u1ea3n v\u1edbi MongoDB Compass<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-qu\u1ea3n-ly-c\u01a1-s\u1edf-d\u1eef-li\u1ec7u\"><strong>Qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>T\u1ea1o Database<\/strong>: Ch\u1ecdn&nbsp;<strong>Create Database<\/strong>&nbsp;-&gt; nh\u1eadp t\u00ean (v\u00ed d\u1ee5:&nbsp;<code>tutorialDB<\/code>) v\u00e0 collection \u0111\u1ea7u ti\u00ean (v\u00ed d\u1ee5:&nbsp;<code>users<\/code>) -&gt; nh\u1ea5n&nbsp;<strong>Create<\/strong>.<\/li>\n\n\n\n<li><strong>Xem Database<\/strong>: Danh s\u00e1ch database n\u1eb1m \u1edf thanh b\u00ean tr\u00e1i. Nh\u1ea5p v\u00e0o t\u00ean database \u0111\u1ec3 m\u1edf c\u00e1c collection b\u00ean trong.<\/li>\n\n\n\n<li><strong>Xo\u00e1 Database<\/strong>: Ch\u1ecdn database -&gt; ch\u1ecdn \u22ee&nbsp; b\u00ean c\u1ea1nh database \u0111\u1ec3 m\u1edf menu -&gt;&nbsp;<strong>Drop Database<\/strong>. H\u1ec7 th\u1ed1ng s\u1ebd y\u00eau c\u1ea7u x\u00e1c nh\u1eadn tr\u01b0\u1edbc khi x\u00f3a to\u00e0n b\u1ed9 d\u1eef li\u1ec7u.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-them-va-xem-d\u1eef-li\u1ec7u\"><strong>Th\u00eam v\u00e0 xem d\u1eef li\u1ec7u<\/strong><\/h3>\n\n\n\n<p><strong>T\u1ea1o Collection<\/strong><\/p>\n\n\n\n<p>Trong m\u1ed9t database ->\u00a0<strong>Create Collection<\/strong>\u00a0-> nh\u1eadp t\u00ean (v\u00ed d\u1ee5:\u00a0<code>users<\/code>).<\/p>\n\n\n\n<p><strong>Xem Document<\/strong><\/p>\n\n\n\n<p>Ch\u1ecdn collection, d\u1eef li\u1ec7u s\u1ebd hi\u1ec3n th\u1ecb d\u1ea1ng b\u1ea3ng ho\u1eb7c JSON trong c\u1eeda s\u1ed5 ch\u00ednh.<\/p>\n\n\n\n<p><strong>Th\u00eam document<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ch\u1ecdn collection -&gt; b\u1ea5m&nbsp;<strong>Insert Document<\/strong>.<\/li>\n\n\n\n<li>Nh\u1eadp d\u1eef li\u1ec7u d\u01b0\u1edbi d\u1ea1ng JSON, v\u00ed d\u1ee5:<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n  \"name\": \"Alice\",\n  \"age\": 25,\n  \"email\": \"alice@example.com\"\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Nh\u1ea5n&nbsp;<strong>Insert<\/strong>, sau \u0111\u00f3 d\u1eef li\u1ec7u s\u1ebd xu\u1ea5t hi\u1ec7n trong b\u1ea3ng d\u1eef li\u1ec7u.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-m\u1ed9t-s\u1ed1-tu\u1ef3-ch\u1ecdn-nang-cao-c\u1ee7a-collection\"><strong>M\u1ed9t s\u1ed1 tu\u1ef3 ch\u1ecdn n\u00e2ng cao c\u1ee7a collection<\/strong><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Capped Collection<\/strong>: Gi\u1edbi h\u1ea1n dung l\u01b0\u1ee3ng l\u01b0u tr\u1eef v\u00e0 t\u1ef1 \u0111\u1ed9ng ghi \u0111\u00e8 d\u1eef li\u1ec7u c\u0169 khi \u0111\u1ea1t m\u1ee9c gi\u1edbi h\u1ea1n, ph\u00f9 h\u1ee3p cho logging ho\u1eb7c event streaming. V\u00ed d\u1ee5 khi l\u01b0u log h\u1ec7 th\u1ed1ng, c\u00f3 th\u1ec3 t\u1ea1o collection&nbsp;<code>system_logs<\/code>&nbsp;v\u1edbi dung l\u01b0\u1ee3ng gi\u1edbi h\u1ea1n 100 MB \u0111\u1ec3 c\u00e1c b\u1ea3n ghi c\u0169 t\u1ef1 \u0111\u1ed9ng b\u1ecb thay th\u1ebf khi \u0111\u1ea7y.<\/li>\n\n\n\n<li><strong>Validation Rules<\/strong>: X\u00e1c \u0111\u1ecbnh schema validator b\u1eb1ng JSON Schema, \u0111\u1ea3m b\u1ea3o d\u1eef li\u1ec7u m\u1edbi nh\u1eadp v\u00e0o \u0111\u00fang \u0111\u1ecbnh d\u1ea1ng mong mu\u1ed1n. V\u00ed d\u1ee5 khi thi\u1ebft l\u1eadp quy t\u1eafc ch\u1ec9 cho ph\u00e9p tr\u01b0\u1eddng&nbsp;<code>age<\/code>&nbsp;l\u00e0 s\u1ed1 v\u00e0 l\u1edbn h\u01a1n 0 b\u1eb1ng c\u00e1ch d\u00f9ng JSON Schema validator.<\/li>\n\n\n\n<li><strong>Collation<\/strong>: Ch\u1ecdn quy t\u1eafc so s\u00e1nh chu\u1ed7i (string collation) cho vi\u1ec7c s\u1eafp x\u1ebfp v\u00e0 t\u00ecm ki\u1ebfm, h\u1eefu \u00edch khi l\u00e0m vi\u1ec7c v\u1edbi ng\u00f4n ng\u1eef c\u00f3 d\u1ea5u ho\u1eb7c ch\u1eef hoa\/th\u01b0\u1eddng. V\u00ed d\u1ee5 khi l\u00e0m vi\u1ec7c v\u1edbi d\u1eef li\u1ec7u ti\u1ebfng Vi\u1ec7t, c\u00f3 th\u1ec3 ch\u1ecdn collation&nbsp;<code>vi_VN<\/code>&nbsp;\u0111\u1ec3 vi\u1ec7c s\u1eafp x\u1ebfp \u201cH\u00f2a\u201d v\u00e0 \u201choa\u201d \u0111\u01b0\u1ee3c x\u1eed l\u00fd ch\u00ednh x\u00e1c.<\/li>\n\n\n\n<li><strong>Time Series Collection<\/strong>: D\u00e0nh cho d\u1eef li\u1ec7u theo th\u1eddi gian (time-based), t\u1ef1 \u0111\u1ed9ng t\u1ed1i \u01b0u ho\u00e1 l\u01b0u tr\u1eef v\u00e0 truy v\u1ea5n theo timestamp. Th\u01b0\u1eddng d\u00f9ng cho IoT, monitoring ho\u1eb7c analytics. V\u00ed d\u1ee5 khi d\u00f9ng cho collection&nbsp;<code>temperature_readings<\/code>&nbsp;ch\u1ee9a d\u1eef li\u1ec7u c\u1ea3m bi\u1ebfn theo t\u1eebng ph\u00fat, gi\u00fap truy v\u1ea5n theo timestampnhanh v\u00e0 ti\u1ebft ki\u1ec7m dung l\u01b0\u1ee3ng h\u01a1n.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-truy-v\u1ea5n-d\u1eef-li\u1ec7u\"><strong>Truy v\u1ea5n d\u1eef li\u1ec7u<\/strong><\/h3>\n\n\n\n<p>\u1ede ph\u1ea7n tr\u00ean c\u00f9ng c\u1ee7a Compass c\u00f3 \u00f4&nbsp;<strong>Filter<\/strong>&nbsp;\u0111\u1ec3 nh\u1eadp \u0111i\u1ec1u ki\u1ec7n t\u00ecm ki\u1ebfm. V\u00ed d\u1ee5 \u0111\u1ec3 t\u00ecm ng\u01b0\u1eddi d\u00f9ng c\u00f3 tu\u1ed5i l\u1edbn h\u01a1n 20:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{ \"age\": { \"$gt\": 20 } }<\/code><\/pre>\n\n\n\n<p>Khi ch\u1ea1y query, Compass s\u1ebd ch\u1ec9 hi\u1ec3n th\u1ecb c\u00e1c document ph\u00f9 h\u1ee3p.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-t\u1ea1o-aggregation-pipeline\"><strong>T\u1ea1o Aggregation Pipeline<\/strong><\/h3>\n\n\n\n<p>Aggregation Pipeline trong MongoDB gi\u00fap x\u1eed l\u00fd d\u1eef li\u1ec7u ph\u1ee9c t\u1ea1p (l\u1ecdc, nh\u00f3m, t\u00ednh to\u00e1n\u2026) v\u1edbi c\u00e1c b\u01b0\u1edbc nh\u01b0 sau:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ch\u1ecdn tab&nbsp;<strong>Aggregation<\/strong>&nbsp;&gt;&gt; nh\u1ea5n&nbsp;<strong>Create New Pipeline<\/strong>.<\/li>\n\n\n\n<li>Th\u00eam t\u1eebng stage. V\u00ed d\u1ee5, \u0111\u1ec3 l\u1ecdc ng\u01b0\u1eddi c\u00f3 tu\u1ed5i \u2265 25 v\u00e0 ch\u1ec9 l\u1ea5y t\u00ean, email:\n<ul class=\"wp-block-list\">\n<li>Stage 1 (Match):<br><code>{ \"age\": { \"$gte\": 25 } }<\/code><\/li>\n\n\n\n<li>Stage 2 (Project):<br><code>{ \"name\": 1, \"email\": 1, \"_id\": 0 }<\/code><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-qu\u1ea3n-ly-indexes\"><strong>Qu\u1ea3n l\u00fd Indexes<\/strong><\/h3>\n\n\n\n<p>Index (ch\u1ec9 m\u1ee5c) c\u00f3 th\u1ec3 coi nh\u01b0 \u201c\u0111\u01b0\u1eddng t\u1eaft\u201d gi\u00fap truy v\u1ea5n d\u1eef li\u1ec7u nhanh h\u01a1n. Thay v\u00ec ph\u1ea3i \u0111i qua to\u00e0n b\u1ed9 collection (full collection scan) v\u1edbi m\u1ed7i l\u1ea7n t\u00ecm ki\u1ebfm d\u1eabn t\u1edbi vi\u1ec7c t\u1ed1n th\u1eddi gian n\u1ebfu d\u1eef li\u1ec7u l\u1edbn th\u00ec index cho ph\u00e9p MongoDB nh\u1ea3y th\u1eb3ng \u0111\u1ebfn v\u1ecb tr\u00ed c\u1ea7n thi\u1ebft. C\u00e1ch ho\u1ea1t \u0111\u1ed9ng n\u00e0y gi\u1ed1ng nh\u01b0 vi\u1ec7c tra c\u1ee9u m\u1ee5c l\u1ee5c trong m\u1ed9t cu\u1ed1n s\u00e1ch: thay v\u00ec \u0111\u1ecdc t\u1eeb trang \u0111\u1ea7u \u0111\u1ebfn trang cu\u1ed1i, b\u1ea1n ch\u1ec9 c\u1ea7n nh\u00ecn v\u00e0o m\u1ee5c l\u1ee5c \u0111\u1ec3 bi\u1ebft ngay trang n\u00e0o ch\u1ee9a th\u00f4ng tin m\u00ecnh mu\u1ed1n. C\u00e1c lo\u1ea1i index g\u1ed3m:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ascending (1): S\u1eafp x\u1ebfp t\u0103ng d\u1ea7n<\/li>\n\n\n\n<li>Descending (-1): S\u1eafp x\u1ebfp gi\u1ea3m d\u1ea7n<\/li>\n\n\n\n<li>Text: Index cho text search<\/li>\n\n\n\n<li>2dsphere: Index cho d\u1eef li\u1ec7u \u0111\u1ecba l\u00fd<\/li>\n\n\n\n<li>Hashed: Index d\u1ea1ng hash<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-cac-thao-tac-c\u01a1-b\u1ea3n-v\u1edbi-index-trong-compass\"><strong>C\u00e1c thao t\u00e1c c\u01a1 b\u1ea3n v\u1edbi index trong Compass<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>T\u1ea1o index<\/strong>: Ch\u1ecdn&nbsp;<strong>Create Index<\/strong>&nbsp;-&gt; nh\u1eadp field (v\u00ed d\u1ee5:&nbsp;<code>email<\/code>) -&gt; ch\u1ecdn h\u01b0\u1edbng:&nbsp;<strong>Ascending (t\u0103ng d\u1ea7n)&nbsp;<\/strong>ho\u1eb7c<strong>&nbsp;Descending (gi\u1ea3m d\u1ea7n)<\/strong>&nbsp;-&gt; nh\u1ea5n&nbsp;<strong>Create<\/strong>.<\/li>\n\n\n\n<li><strong>Xem index<\/strong>: Compass hi\u1ec3n th\u1ecb danh s\u00e1ch index hi\u1ec7n c\u00f3 c\u1ee7a collection.<\/li>\n\n\n\n<li><strong>X\u00f3a index<\/strong>: Ch\u1ecdn index c\u1ea7n xo\u00e1 -&gt; nh\u1ea5n Drop Index.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"h-cac-tuy-ch\u1ecdn-nang-cao-trong-ph\u1ea7n-index-management\"><strong>C\u00e1c t\u00f9y ch\u1ecdn n\u00e2ng cao trong ph\u1ea7n Index Management<\/strong><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Unique Index<\/strong>: \u0110\u1ea3m b\u1ea3o gi\u00e1 tr\u1ecb kh\u00f4ng b\u1ecb tr\u00f9ng l\u1eb7p trong tr\u01b0\u1eddng ch\u1ec9 m\u1ee5c. V\u00ed d\u1ee5 \u0111\u1ec3 ng\u0103n ng\u01b0\u1eddi d\u00f9ng \u0111\u0103ng k\u00fd tr\u00f9ng email ta t\u1ea1o unique index tr\u00ean tr\u01b0\u1eddng email trong collection users.<\/li>\n\n\n\n<li><strong>Ch\u1ec9 m\u1ee5c to\u00e0n v\u0103n b\u1ea3n (Text Index)<\/strong>: Text Index gi\u1ed1ng nh\u01b0 c\u00f4ng c\u1ee5 \u201cCtrl + F\u201d nh\u01b0ng ho\u1ea1t \u0111\u1ed9ng \u1edf m\u1ee9c c\u01a1 s\u1edf d\u1eef li\u1ec7u, gi\u00fap nhanh ch\u00f3ng t\u00ecm v\u0103n b\u1ea3n trong h\u00e0ng tri\u1ec7u b\u1ea3n ghi m\u00e0 kh\u00f4ng c\u1ea7n qu\u00e9t th\u1ee7 c\u00f4ng to\u00e0n b\u1ed9 d\u1eef li\u1ec7u. V\u00ed d\u1ee5 \u0111\u1ec3 t\u00ecm m\u1ecdi s\u1ea3n ph\u1ea9m c\u00f3 t\u1eeb \u2018pin\u2019 trong m\u00f4 t\u1ea3, ta t\u1ea1o index d\u1ea1ng text tr\u00ean tr\u01b0\u1eddng&nbsp;<code>description<\/code>&nbsp;nh\u01b0&nbsp;<code>$text: { $search: \"pin\" }<\/code>.<\/li>\n\n\n\n<li><strong>TTL Index (Time To Live)<\/strong>: T\u1ef1 \u0111\u1ed9ng x\u00f3a t\u00e0i li\u1ec7u sau th\u1eddi gian x\u00e1c \u0111\u1ecbnh. V\u00ed d\u1ee5 \u0111\u1ec3 t\u1ef1 x\u00f3a c\u00e1c phi\u00ean h\u1ebft h\u1ea1n ta d\u00f9ng collection sessions c\u00f3 tr\u01b0\u1eddng&nbsp;<code>createdAt<\/code>&nbsp;v\u00e0 \u0111\u1eb7t TTL = 3600 gi\u00e2y (1 gi\u1edd).<\/li>\n\n\n\n<li><strong>Partial Index<\/strong>: Ch\u1ec9 l\u1eadp ch\u1ec9 m\u1ee5c cho c\u00e1c t\u00e0i li\u1ec7u th\u1ecfa \u0111i\u1ec1u ki\u1ec7n c\u1ee5 th\u1ec3, ti\u1ebft ki\u1ec7m dung l\u01b0\u1ee3ng v\u00e0 t\u1ed1i \u01b0u truy v\u1ea5n. V\u00ed d\u1ee5 ta l\u1eadp ch\u1ec9 m\u1ee5c cho c\u00e1c \u0111\u01a1n h\u00e0ng ch\u01b0a ho\u00e0n t\u1ea5t b\u1eb1ng filter&nbsp;<code>{ status: \"pending\" }<\/code>.<\/li>\n\n\n\n<li><strong>Geospatial Index<\/strong>: D\u00f9ng \u0111\u1ec3 x\u1eed l\u00fd d\u1eef li\u1ec7u v\u1ecb tr\u00ed (to\u1ea1 \u0111\u1ed9), ph\u1ee5c v\u1ee5 c\u00e1c truy v\u1ea5n nh\u01b0 t\u00ecm \u0111\u1ecba \u0111i\u1ec3m g\u1ea7n nh\u1ea5t. V\u00ed d\u1ee5 v\u1edbi d\u1eef li\u1ec7u \u0111\u1ecba \u0111i\u1ec3m c\u00f3 tr\u01b0\u1eddng location:&nbsp;<code>{ type: \"Point\", coordinates: [x, y] }<\/code>, ta t\u1ea1o 2dsphere index \u0111\u1ec3 ch\u1ea1y truy v\u1ea5n t\u00ecm c\u1eeda h\u00e0ng g\u1ea7n nh\u1ea5t.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-cau-h\u1ecfi-th\u01b0\u1eddng-g\u1eb7p-v\u1ec1-mongodb-compass\"><span class=\"ez-toc-section\" id=\"Cau_hoi_thuong_gap_ve_MongoDB_Compass\"><\/span><strong>C\u00e2u h\u1ecfi th\u01b0\u1eddng g\u1eb7p v\u1ec1 MongoDB Compass<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-compass-isolated-edition-la-gi\"><strong>Compass Isolated Edition l\u00e0 g\u00ec?<\/strong><\/h3>\n\n\n\n<p>Compass isolated edition l\u00e0 phi\u00ean b\u1ea3n \u0111\u1eb7c bi\u1ec7t c\u1ee7a Compass, \u0111\u01b0\u1ee3c thi\u1ebft k\u1ebf cho c\u00e1c m\u00f4i tr\u01b0\u1eddng c\u00f3 y\u00eau c\u1ea7u b\u1ea3o m\u1eadt cao ho\u1eb7c b\u1ecb h\u1ea1n ch\u1ebf k\u1ebft n\u1ed1i Internet. Trong \u0111\u00f3 t\u1ea5t c\u1ea3 k\u1ebft n\u1ed1i ra ngo\u00e0i \u0111\u1ec1u b\u1ecb ch\u1eb7n v\u00e0 ch\u1ec9 cho ph\u00e9p k\u1ebft n\u1ed1i \u0111\u1ebfn server MongoDB m\u00e0 b\u1ea1n ch\u1ecdn, gi\u00fap t\u0103ng b\u1ea3o m\u1eadt v\u00e0 kh\u00f4ng c\u1ea7n c\u1ea5u h\u00ecnh t\u01b0\u1eddng l\u1eeda b\u1ed5 sung.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-dung-mongodb-compass-co-\u1ea3nh-h\u01b0\u1edfng-hi\u1ec7u-nang-khong\"><strong>D\u00f9ng MongoDB compass c\u00f3 \u1ea3nh h\u01b0\u1edfng hi\u1ec7u n\u0103ng kh\u00f4ng?<\/strong><\/h3>\n\n\n\n<p>Trong h\u1ea7u h\u1ebft c\u00e1c tr\u01b0\u1eddng h\u1ee3p, Compass ch\u1ec9 t\u00e1c \u0111\u1ed9ng r\u1ea5t nh\u1ecf \u0111\u1ebfn hi\u1ec7u n\u0103ng h\u1ec7 th\u1ed1ng. Tuy nhi\u00ean, \u0111\u1ec3 tr\u00e1nh l\u00e0m ch\u1eadm \u1ee9ng d\u1ee5ng, ta n\u00ean ch\u1ea1y c\u00e1c truy v\u1ea5n c\u00f3 index \u0111\u1ec3 Compass kh\u00f4ng ph\u1ea3i qu\u00e9t to\u00e0n b\u1ed9 collection, g\u00e2y \u1ea3nh h\u01b0\u1edfng hi\u1ec7u n\u0103ng.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-compass-x\u1eed-ly-d\u1eef-li\u1ec7u-nh\u1ea1y-c\u1ea3m-nh\u01b0-th\u1ebf-nao\"><strong>Compass x\u1eed l\u00fd d\u1eef li\u1ec7u nh\u1ea1y c\u1ea3m nh\u01b0 th\u1ebf n\u00e0o?<\/strong><\/h3>\n\n\n\n<p>Compass l\u01b0u tr\u1eef c\u00e1c th\u00f4ng tin nh\u1ea1y c\u1ea3m (nh\u01b0 m\u1eadt kh\u1ea9u, passphrase SSL\/TLS, SSH tunneling) th\u00f4ng qua API qu\u1ea3n l\u00fd m\u1eadt kh\u1ea9u c\u1ee7a h\u1ec7 \u0111i\u1ec1u h\u00e0nh. C\u00e1c d\u1eef li\u1ec7u n\u00e0y \u0111\u01b0\u1ee3c m\u00e3 h\u00f3a v\u00e0 ch\u1ec9 c\u00f3 Compass m\u1edbi c\u00f3 th\u1ec3 truy c\u1eadp, gi\u00fap b\u1ea3o v\u1ec7 an to\u00e0n cho th\u00f4ng tin \u0111\u0103ng nh\u1eadp c\u1ee7a ng\u01b0\u1eddi d\u00f9ng.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-t\u1ed5ng-k\u1ebft\"><span class=\"ez-toc-section\" id=\"Tong_ket\"><\/span><strong>T\u1ed5ng k\u1ebft<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>MongoDB Compass mang \u0111\u1ebfn tr\u1ea3i nghi\u1ec7m tr\u1ef1c quan, d\u1ec5 s\u1eed d\u1ee5ng v\u00e0 m\u1ea1nh m\u1ebd, gi\u00fap ng\u01b0\u1eddi d\u00f9ng t\u1eeb ng\u01b0\u1eddi m\u1edbi h\u1ecdc \u0111\u1ebfn l\u1eadp tr\u00ecnh vi\u00ean chuy\u00ean nghi\u1ec7p thao t\u00e1c v\u1edbi MongoDB hi\u1ec7u qu\u1ea3 h\u01a1n. V\u1edbi c\u00e1c t\u00ednh n\u0103ng nh\u01b0 qu\u1ea3n l\u00fd c\u01a1 s\u1edf d\u1eef li\u1ec7u, ph\u00e2n t\u00edch schema, t\u1ed1i \u01b0u truy v\u1ea5n v\u00e0 x\u00e2y d\u1ef1ng pipeline tr\u1ef1c quan, Compass l\u00e0 c\u00f4ng c\u1ee5 kh\u00f4ng th\u1ec3 thi\u1ebfu trong h\u00e0nh tr\u00ecnh h\u1ecdc t\u1eadp v\u00e0 l\u00e0m vi\u1ec7c v\u1edbi MongoDB.<\/p>\n\n\n\n<p>ITviec hy v\u1ecdng b\u00e0i vi\u1ebft tr\u00ean \u0111\u00e3 cung c\u1ea5p cho b\u1ea1n nh\u1eefng ki\u1ebfn th\u1ee9c b\u1ed5 \u00edch gi\u00fap b\u1ea1n hi\u1ec3u r\u00f5 h\u01a1n v\u1ec1 MongoDB Compass.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MongoDB l\u00e0 m\u1ed9t trong nh\u1eefng c\u01a1 s\u1edf d\u1eef li\u1ec7u NoSQL ph\u1ed5 bi\u1ebfn nh\u1ea5t hi\u1ec7n nay. Tuy nhi\u00ean, vi\u1ec7c thao t\u00e1c tr\u1ef1c ti\u1ebfp b\u1eb1ng d\u00f2ng l\u1ec7nh (Shell) \u0111\u00f4i khi g\u00e2y kh\u00f3 kh\u0103n, \u0111\u1eb7c bi\u1ec7t v\u1edbi ng\u01b0\u1eddi m\u1edbi b\u1eaft \u0111\u1ea7u. \u0110\u00f3 l\u00e0 l\u00fac b\u1ea1n c\u1ea7n \u0111\u1ebfn MongoDB Compass \u2013 c\u00f4ng c\u1ee5 giao di\u1ec7n \u0111\u1ed3 h\u1ecda (GUI) ch\u00ednh [&hellip;]<\/p>\n","protected":false},"author":209,"featured_media":93087,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_gspb_post_css":"","footnotes":""},"categories":[109,7226],"tags":[],"class_list":["post-92274","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chuyen-mon-it","category-database"],"blocksy_meta":[],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.8 (Yoast SEO v27.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>MongoDB compass: C\u00e1ch s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 tr\u1ef1c quan qu\u1ea3n l\u00fd CSDL - ITviec Blog<\/title>\n<meta name=\"description\" content=\"T\u00ecm hi\u1ec3u MongoDB Compass - c\u00f4ng c\u1ee5 h\u1eefu \u00edch gi\u00fap thao t\u00e1c v\u1edbi MongoDB nhanh ch\u00f3ng v\u00e0 ti\u1ec7n l\u1ee3i.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/\" \/>\n<meta property=\"og:locale\" content=\"vi_VN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"MongoDB compass: C\u00e1ch s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 tr\u1ef1c quan qu\u1ea3n l\u00fd CSDL\" \/>\n<meta property=\"og:description\" content=\"MongoDB l\u00e0 m\u1ed9t trong nh\u1eefng c\u01a1 s\u1edf d\u1eef li\u1ec7u NoSQL ph\u1ed5 bi\u1ebfn nh\u1ea5t hi\u1ec7n nay. Tuy nhi\u00ean, vi\u1ec7c thao t\u00e1c tr\u1ef1c ti\u1ebfp b\u1eb1ng d\u00f2ng l\u1ec7nh (Shell) \u0111\u00f4i khi g\u00e2y kh\u00f3 kh\u0103n, \u0111\u1eb7c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/\" \/>\n<meta property=\"og:site_name\" content=\"ITviec Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ITviec\" \/>\n<meta property=\"article:published_time\" content=\"2025-11-24T04:05:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-24T04:05:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/11\/mongodb-compass-scaled.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"421\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"M\u1ef9 Duy\u00ean\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ITviec\" \/>\n<meta name=\"twitter:site\" content=\"@ITviec\" \/>\n<meta name=\"twitter:label1\" content=\"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi\" \/>\n\t<meta name=\"twitter:data1\" content=\"M\u1ef9 Duy\u00ean\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc\" \/>\n\t<meta name=\"twitter:data2\" content=\"17 ph\u00fat\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"MongoDB compass: C\u00e1ch s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 tr\u1ef1c quan qu\u1ea3n l\u00fd CSDL - ITviec Blog","description":"T\u00ecm hi\u1ec3u MongoDB Compass - c\u00f4ng c\u1ee5 h\u1eefu \u00edch gi\u00fap thao t\u00e1c v\u1edbi MongoDB nhanh ch\u00f3ng v\u00e0 ti\u1ec7n l\u1ee3i.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/","og_locale":"vi_VN","og_type":"article","og_title":"MongoDB compass: C\u00e1ch s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 tr\u1ef1c quan qu\u1ea3n l\u00fd CSDL","og_description":"MongoDB l\u00e0 m\u1ed9t trong nh\u1eefng c\u01a1 s\u1edf d\u1eef li\u1ec7u NoSQL ph\u1ed5 bi\u1ebfn nh\u1ea5t hi\u1ec7n nay. Tuy nhi\u00ean, vi\u1ec7c thao t\u00e1c tr\u1ef1c ti\u1ebfp b\u1eb1ng d\u00f2ng l\u1ec7nh (Shell) \u0111\u00f4i khi g\u00e2y kh\u00f3 kh\u0103n, \u0111\u1eb7c","og_url":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/","og_site_name":"ITviec Blog","article_publisher":"https:\/\/www.facebook.com\/ITviec","article_published_time":"2025-11-24T04:05:28+00:00","article_modified_time":"2025-11-24T04:05:32+00:00","og_image":[{"width":800,"height":421,"url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/11\/mongodb-compass-scaled.png","type":"image\/png"}],"author":"M\u1ef9 Duy\u00ean","twitter_card":"summary_large_image","twitter_creator":"@ITviec","twitter_site":"@ITviec","twitter_misc":{"\u0110\u01b0\u1ee3c vi\u1ebft b\u1edfi":"M\u1ef9 Duy\u00ean","\u01af\u1edbc t\u00ednh th\u1eddi gian \u0111\u1ecdc":"17 ph\u00fat"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#article","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/"},"author":{"name":"M\u1ef9 Duy\u00ean","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/73733c0725c7e39e696a896bd1abe2d7"},"headline":"MongoDB compass: C\u00e1ch s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 tr\u1ef1c quan qu\u1ea3n l\u00fd CSDL","datePublished":"2025-11-24T04:05:28+00:00","dateModified":"2025-11-24T04:05:32+00:00","mainEntityOfPage":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/"},"wordCount":4640,"publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"image":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/11\/mongodb-compass-scaled.png","articleSection":["Chuy\u00ean m\u00f4n IT","Database"],"inLanguage":"vi"},{"@type":"WebPage","@id":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/","url":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/","name":"MongoDB compass: C\u00e1ch s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 tr\u1ef1c quan qu\u1ea3n l\u00fd CSDL - ITviec Blog","isPartOf":{"@id":"https:\/\/itviec.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#primaryimage"},"image":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#primaryimage"},"thumbnailUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/11\/mongodb-compass-scaled.png","datePublished":"2025-11-24T04:05:28+00:00","dateModified":"2025-11-24T04:05:32+00:00","description":"T\u00ecm hi\u1ec3u MongoDB Compass - c\u00f4ng c\u1ee5 h\u1eefu \u00edch gi\u00fap thao t\u00e1c v\u1edbi MongoDB nhanh ch\u00f3ng v\u00e0 ti\u1ec7n l\u1ee3i.","breadcrumb":{"@id":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#breadcrumb"},"inLanguage":"vi","potentialAction":[{"@type":"ReadAction","target":["https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/"]}]},{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#primaryimage","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/11\/mongodb-compass-scaled.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2025\/11\/mongodb-compass-scaled.png","width":800,"height":421,"caption":"mongodb compass - itviec blog"},{"@type":"BreadcrumbList","@id":"https:\/\/itviec.com\/blog\/huong-dan-su-dung-mongodb-compass\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Chuy\u00ean m\u00f4n IT","item":"https:\/\/itviec.com\/blog\/chuyen-mon-it\/"},{"@type":"ListItem","position":2,"name":"MongoDB compass: C\u00e1ch s\u1eed d\u1ee5ng c\u00f4ng c\u1ee5 tr\u1ef1c quan qu\u1ea3n l\u00fd CSDL"}]},{"@type":"WebSite","@id":"https:\/\/itviec.com\/blog\/#website","url":"https:\/\/itviec.com\/blog\/","name":"ITviec Blog","description":"IT Jobs &amp; People in Vietnam","publisher":{"@id":"https:\/\/itviec.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/itviec.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"vi"},{"@type":"Organization","@id":"https:\/\/itviec.com\/blog\/#organization","name":"ITviec","url":"https:\/\/itviec.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2018\/12\/itviec-black-square-facebook.png","width":1800,"height":1800,"caption":"ITviec"},"image":{"@id":"https:\/\/itviec.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ITviec","https:\/\/x.com\/ITviec","https:\/\/www.linkedin.com\/company\/itviec","https:\/\/www.youtube.com\/channel\/UCYthAQ3bcGr57M_ag5gHDvQ"]},{"@type":"Person","@id":"https:\/\/itviec.com\/blog\/#\/schema\/person\/73733c0725c7e39e696a896bd1abe2d7","name":"M\u1ef9 Duy\u00ean","image":{"@type":"ImageObject","inLanguage":"vi","@id":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Author_Duyen-Tran-120x120.jpg","url":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Author_Duyen-Tran-120x120.jpg","contentUrl":"https:\/\/itviec.com\/blog\/wp-content\/uploads\/2024\/03\/Author_Duyen-Tran-120x120.jpg","caption":"M\u1ef9 Duy\u00ean"},"url":"https:\/\/itviec.com\/blog\/author\/my-duyen\/"}]}},"_links":{"self":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/92274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/users\/209"}],"replies":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/comments?post=92274"}],"version-history":[{"count":3,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/92274\/revisions"}],"predecessor-version":[{"id":93088,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/posts\/92274\/revisions\/93088"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media\/93087"}],"wp:attachment":[{"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/media?parent=92274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/categories?post=92274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itviec.com\/blog\/wp-json\/wp\/v2\/tags?post=92274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}