Click here to Skip to main content
15,891,607 members
Articles / Database Development / MongoDB
Tip/Trick

Connect MongoShell to Atlas Cluster on Windows 10

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
11 Jul 2017CPOL1 min read 4.1K   1  
Steps to connect Mongo shell to Atlas Cluster

Introduction

This tip is related to MongoDB. You must be thinking why I wrote this tip if there are already videos and articles related to "How to connect MongoShell to Atlas cluster." Yes absolutely, there are multiple articles related to that but when I tried to do it on Windows 10, then I found it is a bit different on this platform and faced a lot of issues for which I didn't get good content which I can refer. Hence, I started writing this article so that it can help someone who is in the same situation. I hope it will help you.

Steps to Connect MongoShell to Atlas Cluster

  1. Download MongoShell from here.
  2. Run .msi file. After the successful run, it will create "MongoDB" named folder inside "Program Files" folder.
  3. Create mongod.cfg file and put in at the path (MongoDB/Server/3.4). The path may vary as per version. Paste the following content into the file:
    systemLog:
    destination:file
    path:c:\Program Files\MongoDB\Server\3.4\data\log\mongod.log
    storage:
    dbPath:c:\Program Files\MongoDB\Server\3.4\data\db

    Please note: If data folder and their subfolder and files are not present, then create them.

  4. Now open the command prompt as administrator and run the following command:
    "c:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" 
    --config "c:\Program Files\MongoDB\Server\3.4\mongod.cfg" --install
  5. Now to start the mongo DB server as a service, you can run the following command:
    net start MongoDB

    Please note: If "db" folder is not created inside "data" folder, then it will not start.

  6. Now to connect to cluster, change the working directory to the following path:

    c:\Program Files\MongoDB\Server\3.4\bin

  7. Now paste the mongo shell command to connect to the cluster. (You can find command when you will create your cluster and logged in site. Then click on connect button. There, you will find command to connect to the cluster.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --