Article Directory
Configuration:
window10
python3.6
A write operation of mongodb:
1. Install MongoDB on Windows platform
1), download the mongodb installation package:
This is the window 10.64 bit installation software, you can download and install it directly: 4.2 version of the window64 bit download address
After entering, select the corresponding system and version:
2), installation steps:
I am lazy here, all the screenshots are installed, follow the steps in the picture to complete the fool-proof installation.
Remember to create a current folder yourself before installation, and use it later.
Choose the location of the installation directory you built here
3) Put the bin folder of the installation directory into the environment variable:
4), verify whether the installation is successful
At this time, open cmd, and enter mongo casually. The following represents success.
2. Install the mongodb management tool compass
1), download address:
This is the address of the management software I use. You can download and install it directly: Window64-bit stable version installation software
2), installation steps:
Create a new directory, I create it here mongodb_tool
:
Click it too fast, there is an install, just click install.
3), link database:
4) Use tools to build a database:
3. Mongodb replicates the database
1. Mongo or mongo --port 27017 enter the database:
mongo
mongo --port 27017
Among them: 27017 is the default port number of the mongodb database, this item should be present during installation, generally you don’t need to write it
2. Copy command:
db.copyDatabase("111_test_database_scrapyd_66ip","111_test_database_scrapyd_66ip3")
among them:
- 111_test_database_scrapyd_66ip is an existing database;
- 111_test_database_scrapyd_66ip3 is a database that does not yet exist. After the command is completed, a database with this name will be generated, and the data will be the same as 111_test_database_scrapyd_66ip.
3. Screenshot steps
Screenshot of the original database: A screenshot of the
copied database: