{"id":162,"date":"2017-04-11T06:36:54","date_gmt":"2017-04-11T13:36:54","guid":{"rendered":"http:\/\/www.kenwalger.com\/blog\/?p=162"},"modified":"2017-06-11T11:16:53","modified_gmt":"2017-06-11T18:16:53","slug":"mongodb-compass-an-overview","status":"publish","type":"post","link":"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-compass-an-overview\/","title":{"rendered":"MongoDB Compass: An Overview"},"content":{"rendered":"<p>When I first started using computers, everything was done through the command line. Everything. Apple had yet to come out with the Macintosh, Windows was not even a glimmer in the eye of Microsoft. For that matter, Microsoft wasn&#8217;t a glimmer yet. Everyone got used to living in the shell and knowing a multitude of commands, arguments, and syntax to achieve even the smallest of tasks. Along came the graphical user interface (GUI) both in terms of operating systems and a variety of tools. Many of these tools provided\u00a0much of the functionality that could be achieved in the command line, certainly, the majority of the most common tasks were included in an easier to use and visualize format.<\/p>\n<p>This is the case for <a href=\"http:\/\/www.mongodb.com\">MongoDB<\/a>&#8216;s <a href=\"https:\/\/www.mongodb.com\/products\/compass\">Compass<\/a>\u00a0product. Since it&#8217;s original release in December of 2015 several versions and upgrades have been added. As of this writing, we are now on version 1.6. Like many GUI tools, it aims to offer an easier interface for accomplishing many tasks one might otherwise do in the\u00a0<a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/mongo-shell\/\">mongo shell<\/a>.\u00a0In this post, I&#8217;d like to take a look at some of the more useful features that Compass provides for managing your MongoDB <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/glossary\/\">databases and collections<\/a>.<\/p>\n<h3>MongoDB Compass Features<\/h3>\n<p>One of the great features of MongoDB is that it has a flexible <a href=\"https:\/\/docs.mongodb.com\/manual\/data-modeling\/\">data model<\/a>. This is a powerful feature for schema design. However, from the shell it can pose limitations on knowing the exact makeup of a collection&#8217;s schema. Compass provides a visual interface which <a href=\"https:\/\/docs.mongodb.com\/compass\/master\/faq\/#compass-faq-sampling\">samples<\/a> a subset of the data in a collection and analyzes the documents from within this subset.<\/p>\n<p><a href=\"http:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/04\/vizualization.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"172\" data-permalink=\"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-compass-an-overview\/attachment\/vizualization\/\" data-orig-file=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/04\/vizualization-e1491882630240.png\" data-orig-size=\"800,346\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"Data Vizualization\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/04\/vizualization-1024x443.png\" class=\"alignnone wp-image-172\" src=\"http:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/04\/vizualization-300x130.png\" alt=\"Data Vizualization\" width=\"316\" height=\"137\" \/><\/a><\/p>\n<p>This provides an easy to see snapshot of how the collection is designed in an easy to use GUI fashion. One gets immediate information on types, ranges, and frequency of fields in a collection. This allows for the ability to easily choose, sort, and query the collection. All based on the data presented in the schema visualization. The same results can certainly be obtained with shell commands. However, the time and effort involved to get there is much greater.<\/p>\n<h3>Database &amp; Collection Interaction<\/h3>\n<p>This feature alone in Compass makes it worth the download, but there is much more! Creating and dropping databases and collections is possible in Compass and, as I pointed out in a previous post on <a href=\"http:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/indexing-in-mongodb\/\">indexing<\/a>\u00a0MongoDB collections, <a href=\"https:\/\/docs.mongodb.com\/manual\/indexes\/\">indexes<\/a> can have a huge impact on the performance of queries.\u00a0Compass provides an intuitive interface for index creation. Once created it provides detailed feedback about the performance of a query. And what and how many steps and time MongoDB had to go through to return the documents.<\/p>\n<figure id=\"attachment_173\" aria-describedby=\"caption-attachment-173\" style=\"width: 244px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/04\/index-creation-window.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"173\" data-permalink=\"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-compass-an-overview\/attachment\/index-creation-window\/\" data-orig-file=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/04\/index-creation-window.png\" data-orig-size=\"673,828\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"index-creation-window\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/04\/index-creation-window.png\" class=\"wp-image-173 size-medium\" src=\"http:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/04\/index-creation-window-244x300.png\" alt=\"Index Creation\" width=\"244\" height=\"300\" srcset=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/04\/index-creation-window-244x300.png 244w, https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/04\/index-creation-window.png 673w\" sizes=\"auto, (max-width: 244px) 85vw, 244px\" \/><\/a><figcaption id=\"caption-attachment-173\" class=\"wp-caption-text\">Create Index with Compass<\/figcaption><\/figure>\n<figure id=\"attachment_156\" aria-describedby=\"caption-attachment-156\" style=\"width: 282px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/03\/with_index.png\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"156\" data-permalink=\"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/indexing-mongodb\/attachment\/with_index\/\" data-orig-file=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/03\/with_index.png\" data-orig-size=\"951,1012\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"With Index\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Find with a defined and used Index&lt;\/p&gt;\n\" data-large-file=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/03\/with_index.png\" class=\"size-medium wp-image-156\" src=\"http:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/03\/with_index-282x300.png\" alt=\"Index Used\" width=\"282\" height=\"300\" srcset=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/03\/with_index-282x300.png 282w, https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/03\/with_index-768x817.png 768w, https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/03\/with_index.png 951w\" sizes=\"auto, (max-width: 282px) 85vw, 282px\" \/><\/a><figcaption id=\"caption-attachment-156\" class=\"wp-caption-text\">Find with a defined and used Index<\/figcaption><\/figure>\n<p>Once again, all of this\u00a0<em>can<\/em> be done in the shell right? We can create an index in the shell with <code>db.collection.createIndex()<\/code> and we can get <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/explain-results\/\">explain<\/a> results in the shell as well. I might argue though that the creation of indexes in Compass is easier with\u00a0many\u00a0of the various index creation nuances during the creation step. Further, being able to see the results of the explain plan visually is of benefit, of course, you can also see the raw <a href=\"http:\/\/www.json.org\/\">JSON<\/a>\u00a0as well for a more in-depth look at the results.<\/p>\n<h3>Dev-Ops features<\/h3>\n<p>The last of the features that I want to discuss in this post is the ability to get insights into some of the operational aspects of the database itself. Compass provides a GUI interface for <a href=\"https:\/\/docs.mongodb.com\/compass\/master\/performance\/\">server performance<\/a> for the metrics of Operations, Read &amp; Write, Network, and Memory usage. It also provides information on the Hottest Collections. Meaning the collections with the most activities as well as information on slow running queries (potential candidates for indexes here). All the information can be obtained from the command line using various tools that come with MongoDB, such as <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/program\/mongostat\/#bin.mongostat\">mongostat<\/a> and <a href=\"https:\/\/docs.mongodb.com\/manual\/reference\/program\/mongotop\/#bin.mongotop\">mongotop<\/a>, and the <a href=\"https:\/\/docs.mongodb.com\/manual\/tutorial\/manage-the-database-profiler\/?_ga=1.209304209.2079735664.1483559375\">profiler<\/a> for slow queries. Once again, the GUI interface provided by Compass provides, in my opinion, an easier way to grasp what is going on with the MongoDB Server.<\/p>\n<h3>Wrap Up<\/h3>\n<p>I realize that Compass is not the end-all answer to MongoDB management. Not all functionality of managing and maintaining a MongoDB database server and associated collections is possible. There are still tasks that currently still require using the command line. Heck, I still wind up using the command line to perform tasks in Windows and OS X. However, for a product that has only been out for less than a year and a half, this is a great start.<\/p>\n<p>Compass has a lot more features that I didn&#8217;t cover here, I would encourage you to <a href=\"https:\/\/www.mongodb.com\/download-center?filter=enterprise#compass\">download<\/a>\u00a0it for your Windows, OS X, or Linux system and discover a new way to visualize your MongoDB data and graphically manage your system.<\/p>\n<p>There are a lot of MongoDB specific terms in this post. I created a <a href=\"https:\/\/www.echoskillstore.com\/MongoDB-Dictionary\/45103\">MongoDB Dictionary<\/a> skill for the <a href=\"https:\/\/www.amazon.com\/gp\/product\/B01DFKC2SO\/ref=as_li_tl?ie=UTF8&amp;camp=1789&amp;creative=9325&amp;creativeASIN=B01DFKC2SO&amp;linkCode=as2&amp;tag=kenwalgersite-20&amp;linkId=f9e513223de2525a72b95cf9561db55b\" target=\"_blank\" rel=\"noopener noreferrer\">Amazon Echo<\/a>\u00a0line of products. Check it out and you can say &#8220;Alexa, ask MongoDB what is the definition of a collection?&#8221; and get a helpful response.<\/p>\n<hr \/>\n<p><em>Follow me on Twitter <a href=\"https:\/\/www.twitter.com\/kenwalger\">@kenwalger<\/a> to get the latest updates on my postings.<\/em><\/p>\n<a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-facebook nolightbox\" data-provider=\"facebook\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Facebook\" href=\"https:\/\/www.facebook.com\/sharer.php?u=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F162&#038;t=MongoDB%20Compass%3A%20An%20Overview&#038;s=100&#038;p&#091;url&#093;=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F162&#038;p&#091;images&#093;&#091;0&#093;=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-content%2Fuploads%2F2017%2F04%2Fmongodb-compass-e1491607950242.png&#038;p&#091;title&#093;=MongoDB%20Compass%3A%20An%20Overview\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"Facebook\" title=\"Share on Facebook\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/facebook.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-twitter nolightbox\" data-provider=\"twitter\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Twitter\" href=\"https:\/\/twitter.com\/intent\/tweet?url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F162&#038;text=Hey%20check%20this%20out\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"twitter\" title=\"Share on Twitter\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/twitter.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-reddit nolightbox\" data-provider=\"reddit\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Reddit\" href=\"https:\/\/www.reddit.com\/submit?url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F162&#038;title=MongoDB%20Compass%3A%20An%20Overview\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"reddit\" title=\"Share on Reddit\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/reddit.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-linkedin nolightbox\" data-provider=\"linkedin\" target=\"_blank\" rel=\"nofollow\" title=\"Share on Linkedin\" href=\"https:\/\/www.linkedin.com\/shareArticle?mini=true&#038;url=https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F162&#038;title=MongoDB%20Compass%3A%20An%20Overview\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px;margin-right:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"linkedin\" title=\"Share on Linkedin\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/linkedin.png\" \/><\/a><a class=\"synved-social-button synved-social-button-share synved-social-size-48 synved-social-resolution-single synved-social-provider-mail nolightbox\" data-provider=\"mail\" rel=\"nofollow\" title=\"Share by email\" href=\"mailto:?subject=MongoDB%20Compass%3A%20An%20Overview&#038;body=Hey%20check%20this%20out:%20https%3A%2F%2Fwww.kenwalger.com%2Fblog%2Fwp-json%2Fwp%2Fv2%2Fposts%2F162\" style=\"font-size: 0px;width:48px;height:48px;margin:0;margin-bottom:5px\"><img loading=\"lazy\" decoding=\"async\" alt=\"mail\" title=\"Share by email\" class=\"synved-share-image synved-social-image synved-social-image-share\" width=\"48\" height=\"48\" style=\"display: inline;width:48px;height:48px;margin: 0;padding: 0;border: none;box-shadow: none\" src=\"https:\/\/www.kenwalger.com\/blog\/wp-content\/plugins\/social-media-feather\/synved-social\/image\/social\/regular\/96x96\/mail.png\" \/><\/a>","protected":false},"excerpt":{"rendered":"<p>When I first started using computers, everything was done through the command line. Everything. Apple had yet to come out with the Macintosh, Windows was not even a glimmer in the eye of Microsoft. For that matter, Microsoft wasn&#8217;t a glimmer yet. Everyone got used to living in the shell and knowing a multitude of &hellip; <a href=\"https:\/\/www.kenwalger.com\/blog\/nosql\/mongodb\/mongodb-compass-an-overview\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;MongoDB Compass: An Overview&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":165,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"pmpro_default_level":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[17,4],"tags":[],"yst_prominent_words":[117,387,378,380,377,381,90,1269,383,108,384,281,978,87,382,271,1268,1031,385,379],"class_list":["post-162","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-visualization","category-mongodb","pmpro-has-access"],"jetpack_featured_media_url":"https:\/\/www.kenwalger.com\/blog\/wp-content\/uploads\/2017\/04\/mongodb-compass-e1491607950242.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8lx70-2C","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/162","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/comments?post=162"}],"version-history":[{"count":11,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/162\/revisions"}],"predecessor-version":[{"id":371,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/posts\/162\/revisions\/371"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/media\/165"}],"wp:attachment":[{"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/media?parent=162"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/categories?post=162"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/tags?post=162"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.kenwalger.com\/blog\/wp-json\/wp\/v2\/yst_prominent_words?post=162"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}