Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Connect MongoShell to Atlas Cluster on Windows 10

0.00/5 (No votes)
11 Jul 2017 2  
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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here