# System Env Path Setting

## System Path Setting

To set the **system environment variable PATH** for **MongoDB Shell (mongosh)**, follow these steps based on your operating system:

### **Windows**

1. **Find the mongosh Path**
   * Default location:

     ```makefile
     C:\Program Files\MongoDB\mongosh\bin
     ```
2. **Set PATH Variable**
   * Open **Start Menu** and search for **"Environment Variables"**
   * Click **"Edit the system environment variables"**
   * In the **System Properties** window, click **"Environment Variables"**
   * Under **System variables**, find **Path** and click **Edit**
   * Click **New**, then paste:

     ```makefile
     C:\Program Files\MongoDB\mongosh\bin
     ```
   * Click **OK** to save changes.
3. **Verify**
   * Open **Command Prompt (cmd) or Windows PowerShell terminal** and type:

     ```bash
     mongosh
     ```
   * If it launches, the configuration is successful.

***

### **MacOS & Linux**

1. **Find the mongosh Path**
   * Default Homebrew install path:

     ```bash
     /opt/homebrew/bin/mongosh
     ```
2. **Set PATH Variable**
   * Open **Terminal** and run:

     ```bash
     echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.bashrc
     ```

     or for **Zsh** (default shell in macOS newer versions):

     ```bash
     echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc
     ```
3. **Apply Changes**

   ```bash
   source ~/.bashrc   # For Bash
   source ~/.zshrc    # For Zsh
   ```
4. **Verify**

   ```bash
   mongosh
   ```

   If it starts successfully, the setup is complete.

This ensures you can use **mongosh** from any terminal or command prompt session without specifying the full path. 🚀


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://reactjs.koida.tech/nosql-database/system-env-path-setting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
