In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to install and uninstall mongoDB in Mac. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
(1) mongodb installation
There are two ways to install the mongodb database.
One is to install using the command line, and the second is to install using HomeBrew, which I install in the second way.
1. Update Homebrew's package database:
$brew update
two。 Install mongodb
$brew install mongodb
After success, the following description appears:
Updating Homebrew...== > Downloading https://homebrew.bintray.com/bottles/mongodb-3.4.4.sierra.bottleAlready downloaded: / Users/liangma/Library/Caches/Homebrew/mongodb-3.4.4.sierra.bottle.tar.gz== > Pouring mongodb-3.4.4.sierra.bottle.tar.gz== > Using the sandbox== > CaveatsTo have launchd start mongodb now and restart at login: brew services start mongodbOr, if you don't want/need a background service you can just run: mongod-- config / usr/local/etc/mongod.conf== > Summary
3. View the installation list
$brew listmongodb (already exists).
4. Start mongodb
$mongod-- config / usr/local/etc/mongod.conf
5. Connect mongodb service
$mongo
6. Use
View all databases
> show dbsadmin 0.000GBdata_person_info 0.000GBlocal 0.000GBtest 0.000GB
Create a database
> use data_person_infoswitched to db data_person_info
View the current database
> dbdata_person_info
Add table data (document)
> db.data_person_info.insert ({'id':'0001','name':'bojue','age':'24'}) WriteResult ({"nInserted": 1})
View table data (document)
> db.data_person_info.find () {"_ id": ObjectId ("59f4c3396564b89187361bfd"), "id": "0001", "name": "bojue", "age": "24"}
(2) uninstall mongodb
Brew uninstall mongodb$ brew list (mongodb no longer exists) the above is how to install and uninstall mongoDB in Mac. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.