brew tap mongodb/brew
brew install mongodb-community@4.4 #Install
brew services start mongodb-community@4.4 #Start
brew install mongodb/brew/mongodb-database-toolsNow, for the GUI (graphic user interface):
brew install --cask mongodb-compass- Open your terminal
- Go to Downloads (
cd Downloads, if you're in root)
curl https://atlas-education.s3.amazonaws.com/sampledata.archive -o sampledata.archivemongorestore --archive=sampledata.archiveYou'll now have various databases to your left. Go to sample_airbnb database and then to the collection listingsAndReviews. You'll notice you have 5555 documents.
Hierarchy in mongo is as follows:
database > collection > document
Go to the filter field and write:
{property_type:"Apartment"}
and then hit Find. The number went down to 3626.
Your first query to a database! 👏