Configuring MongoDB to Run as a Windows Service
Before registering the database daemon, establish separate locatiosn for data persistence and system logs to prevent clutter in the installation root.
Create the following directory structure:
mkdir "D:\\App\\MongoDB\\data"
mkdir "D:\\App\\MongoDB\\logs"
Validate the configuration by running the binary manually using the specified data path. Navigate to the execution folder and invoke the server executable.
cd "C:\\App\\MongoDB\\bin"
.\