{"id":8077,"date":"2020-06-18T10:31:47","date_gmt":"2020-06-18T15:31:47","guid":{"rendered":"https:\/\/bobbeaty.com\/wp\/?p=8077"},"modified":"2020-06-19T09:01:30","modified_gmt":"2020-06-19T14:01:30","slug":"working-with-mongodb-again","status":"publish","type":"post","link":"https:\/\/bobbeaty.com\/wp\/archives\/8077","title":{"rendered":"Working with MongoDB Again"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/bobbeaty.com\/wp\/wp-content\/uploads\/2011\/04\/mongoDB.jpg\" alt=\"MongoDB\" title=\"mongoDB.jpg\" border=\"0\" width=\"130\" height=\"43\" style=\"float:right; margin-left:10px;\" \/><\/p>\n<p>As part of the onboarding process at The Shop, today was getting set up with the development tools to run all the Docker containers for an <em>Airplane Mode<\/em> development set-up on my laptop. Nice... I have always liked that mode - as it limits damage that can be done, and at the same time, allows everyone to develop without stepping on each other's toes.<\/p>\n<p>I've used MongoDB before - back at PEAK6 with the MMD (Magic Middle Dude), and there was a lot ot like about it back in 2011, but they certainly have been making changes since then, and it was fun to get back to working with it - but the first thing was to get a decent command-line client for mongo - and thankfully, <a href=\"https:\/\/brew.sh\">Homebrew<\/a> was there to help!<\/p>\n<p>The steps are pretty easy - given that I didn't want to <em>run<\/em> mongo on my laptop - Docker was here for all that... I just needed the client:<\/p>\n<pre class=\"bash\" style=\"font-family:monospace;\">  $ brew tap mongodb<span style=\"color: #000000; font-weight: bold;\">\/<\/span>brew\n  $ brew <span style=\"color: #c20cb9; font-weight: bold;\">install<\/span> mongodb-community-shell<\/pre>\n<p>and then it's ready to use as <tt>mongo<\/tt>. Could not be simpler!<\/p>\n<p>Running it against the Dockerized replica set, that was part of the set-up, wasn't bad:<\/p>\n<pre class=\"bash\" style=\"font-family:monospace;\">  $ mongo <span style=\"color: #660033;\">--host<\/span> rsetname<span style=\"color: #000000; font-weight: bold;\">\/<\/span>host1:<span style=\"color: #000000;\">27017<\/span>,host2:<span style=\"color: #000000;\">27017<\/span>,host3:<span style=\"color: #000000;\">27017<\/span> \\\n          <span style=\"color: #660033;\">--username<\/span> dev-guy  <span style=\"color: #660033;\">--password<\/span> dev-local \\\n          <span style=\"color: #660033;\">--authenticationDatabase<\/span> dev-local<\/pre>\n<p>This is just the example of the replica set called <tt>rsetname<\/tt> running on the three hosts called <tt>host1<\/tt>, <tt>host2<\/tt>, and <tt>host3<\/tt> - all on the default mongo port of 27017. The username, password, and authentication database are all simple examples, and this is all easily made into an alias that makes it even easier to start.<\/p>\n<p>I'm looking forward to working with mongoDB again... it's been a while.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of the onboarding process at The Shop, today was getting set up with the development tools to run all the Docker containers for an Airplane Mode development set-up on my laptop. Nice&#8230; I have always liked that mode &#8211; as it limits damage that can be done, and at the same time, allows [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[],"class_list":["post-8077","post","type-post","status-publish","format-standard","hentry","category-coding","category-open-source-software"],"_links":{"self":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts\/8077","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/comments?post=8077"}],"version-history":[{"count":1,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts\/8077\/revisions"}],"predecessor-version":[{"id":8078,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/posts\/8077\/revisions\/8078"}],"wp:attachment":[{"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/media?parent=8077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/categories?post=8077"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bobbeaty.com\/wp\/wp-json\/wp\/v2\/tags?post=8077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}