First update all package definitions (formulae) and Homebrew itself:
brew update
Upgrade everything with:
brew upgrade
You can now list which of your installed packages (kegs) are outdated with:
brew outdated
for cask in `brew list --cask`; do
brew upgrade --cask $cask;
done
# Or this shorthand
brew upgrade --cask $(brew list --cask)
brew upgrade mongodb
brew update # Get most recent versions of available formulae and casks
brew outdated # Lists the outdated installed formulae and casks
brew upgrade # Upgrade the packages listed by brew outdated
brew upgrade <formula or cask> # Upgrade a specific formula or cask
#This updates homebrew itself.
brew update
#You can then upgrade all individual packages and formula with the following:
brew upgrade