Michael Treat
Github - https://github.com/michaeltreat/
LinkedIn - https://www.linkedin.com/in/michaeltreat/
Phone: (206)512-6275
Address: 208 130th Place North-East, Bellevue, WA 98005
Github - https://github.com/michaeltreat/
LinkedIn - https://www.linkedin.com/in/michaeltreat/
Phone: (206)512-6275
Address: 208 130th Place North-East, Bellevue, WA 98005
This is a Cheat Sheet for interacting with the Mongo Shell ( mongo on your command line). This is for MongoDB Community Edition.
Mongo Manual can help you with getting started using the Shell.
FAQ for MongoDB Fundamentals and other FAQs can be found in the side-bar after visiting that link.
This doc will guide you through installing Mongo DB using WSL through the Command Line.
Most of the steps are listed out here, but this guide will trim them down and make it more straight forward for our needs. There is also 1 step that is not in the link above as well, which will be noted when we come across it.
This install is pretty different from previous versions of psql install instructions for windows. This install uses the WSL and Ubuntu shell.
We are installing this through the Ubuntu command line which is different from the other Ubuntu install instructions because those instructions use Ubuntu's GUI, which we don't have access to here.
cd ~/../../
.sudo apt-get update
Typically we will always be working in the Windows PowerShell, but for this task we need to be in the Ubuntu app because we need to edit a file in the Ubuntu File System.
It is also highly recommended that you DO NOT edit a file in the Ubuntu system from Windows or through a Windows app as there will be errors, so we are doing this the right way by going through Ubuntu's commandline editor Nano.
At the end, this will add some coloring to your command line, and you command line will be formatted like this:
PathToCurrentDirectory[GitStatus]$
WSL stands for Windows Subsystem for Linux and it is a feature that you can enable on Windows 10 machines. It allows for you to add a Linux subsystem to your Windows machine. This subsystem will allow you to run programs and files in a POSIX or Unix-like environment, which solves many common issues that Windows users face when trying to run software that is developed for Linux.
Before you begin check to make sure that you have the most recent version of Windows 10.
The command heroku pg:push
essentially executes two commands under the hood. First, it executes pg_dump, which makes a backup file of a specific database. Then, it pipes that file into pg_restore, where it takes that dump file and uses it to restore another database. The way we usually use it is to push a local database to a deployed heroku database.
The problem is that on windows, the command breaks while trying to pipe in the backup file from pg_dump to pg_restore, so we need to do these two commands manually.