You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-10Lines changed: 23 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,13 @@
6
6
> - Imports `(mongorestore)` the exported binary database into a new database.
7
7
> - Drops a specified localhost database.
8
8
9
+
### Table of Contents
10
+
11
+
-[Dependencies](#dependencies)
12
+
-[Content](#content)
13
+
-[Usage and Installation](#usage-and-installation)
14
+
-[Troubleshooting](#troubleshooting)
15
+
9
16
10
17
11
18
### Dependencies
@@ -64,7 +71,7 @@ Version is not strict, but for reference, the project used **MongoDB Community S
64
71
Windows batch script to automate switching of MongoDB database credentials for a faster database export `(mongodump)`, import `(mongorestore)` and database drop process.
@@ -81,23 +88,29 @@ Windows batch script to automate switching of MongoDB database credentials for a
81
88
| 4 | Enter user name | MongoDB user name |
82
89
| 5 | Enter password | MongoDB user password |
83
90
| 6 | Enter mongo shell | The available and active MongoDB shell. Choose:<br> - `mongo` (for MongoDB v4.2.0 or lower versions) <br>- `mongosh` (for MongoDB v4.4.0 or higher versions)|
84
-
| 7 | Save | Saves the encoded database credentials for future use to a `.env` and exit to the main screen. |
85
-
| 8 | Save and Export Database | Saves the mongodb settings to a `.env` file and starts the Export Database process. |
86
-
| 9 | Save and Import Database | Saves the mongodb settings to a `.env` file and starts to the Import Database process. |
87
-
| 10 | Export Database | Exports (`mongodump`) Exports the database defined in the MongoDB Connection Credentials Setup to a database in binary JSON format.<br> - **NOTE:** Choosing this option will NOT save recent updates made to the database credentials. |
88
-
| 11 | Import Database | Imports (`mongorestore`) a binary database to the database defined in the MongoDB Connection Credentials settings.<br>It expects to find binary database contents in subdirectories relative to the script, similar to the output of the **[10] Export Database option**.<br>**NOTE:** Choosing this option will NOT save recent updates made to the database credentials. |
91
+
| 7 | Save | Saves the encoded database credentials for future use to a `.env` file and exit to the main screen. |
92
+
| 8 | Save and Export Database | Saves the mongodb settings to a `.env` file and starts the **Export Database** process. |
93
+
| 9 | Save and Import Database | Saves the mongodb settings to a `.env` file and starts to the **Import Database** process. |
94
+
| 10 | Export Database | Exports (`mongodump`) the database defined in the MongoDB Connection Credentials Setup to a database in binary JSON format.<br> - **NOTE:** Choosing this option will NOT save recent updates made to the database credentials.<br>- Type `"Y"` and press ENTER if you want to use the `"mongo+srv://"` SRV Connection String.<br>- Type `"n"` and press ENTER if you want to use the `"mongo://"` Standard Connection String. |
95
+
| 11 | Import Database | Imports (`mongorestore`) a binary database to the database defined in the MongoDB Connection Credentials settings.<br>It expects to find binary database contents in subdirectories relative to the script, similar to the output of the **[10] Export Database option**.<br>- **NOTE:** Choosing this option will NOT save recent updates made to the database credentials.<br>- Type `"Y"` and press ENTER if you want to use the `"mongo+srv://"` SRV Connection String.<br>- Type `"n"` and press ENTER if you want to use the `"mongo://"` Standard Connection String. |
89
96
| x | Exit | Exit the script. |
90
97
91
-
4. The **VIEWING THE [ACTIVE] MONGODB CONNECTION CREDENTIALS** screen provides quick links for database import, export, drop, and database credentials updating, which will be accessible after saving the initial database credentials required from the **MONGODB CONNECTION CREDENTIALS SETUP**.
98
+
4. The **VIEWING THE [ACTIVE] MONGODB CONNECTION CREDENTIALS** screen provides quick links for database import, export, drop, and database credentials updating, which will be accessible after saving the initial database credentials required from the **MONGODB CONNECTION CREDENTIALS SETUP**.<br>
99
+
100
+
The **Export Database**, **Import Database**, and **List Databases** options will prompt selecting the `"mongo+srv://"` SRV Connection String. Type `"Y"` or `"n"` and press ENTER when prompted.
101
+
- Type `"Y"` and press ENTER if you want to use the `"mongo+srv://"` SRV Connection String.
102
+
- Type `"n"` and press ENTER if you want to use the `"mongo://"` Standard Connection String.
92
103
93
104
| NO. | Prompt | Description |
94
105
|---|---|---|
95
106
| 1 | Export Database | Exports (`mongodump`) the database defined in the MongoDB Connection Credentials Setup to a binary JSON format database. |
96
107
| 2 | Import Database | Imports (`mongorestore`) the database defined in the MongoDB Connection Credentials settings to a local binary JSON format database relative to the script's location |
97
108
| 3 | Drop Database | It deletes a database defined in the MongoDB connection credentials. Currently available only for localhost MongoDB. |
98
-
| 4 | Update Connection Credentials | Displays the **MONGODB CONNECTION CREDENTIALS SETUP** screen for editing the stored database connection details. |
0 commit comments