MongoDb Setup

MongoDb Setup

Installing MongoDB Community Edition on Ubuntu 18.04 EC2 instance in AWS

Installing the MongoDB in ubuntu via aptitude is very simple

To install MongoDB Community on your Ubuntu system, these instructions will use the official mongodb-org package, which is maintained and supported by MongoDB Inc.

We have 2 ways to install and step mongodb on aws

  1. Directly from source

  2. Using by docker

1. Directly from source

Import the public key used by the package management system

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

Add Sources

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.4.list

Reload local package database.

sudo apt update

Install the MongoDB packages.

sudo apt install -y mongodb-org

Start and verify the service

sudo systemctl start mongod sudo systemctl status mongod

Enable the service start on every reboot

sudo systemctl enable mongod

To access MongoDB, run the following command

mongo > show dbs

By default, there are three databases that are created upon installation. These are admin, config, and local.

Create a user credential for manage remotely

> use admin > db.createUser( { user: "admin", pwd: "admin", roles: [ { role: "readWrite", db: "admin" } ] } )

You can check users list

> show users

Now create new database

> use master

create default collections

> db.createCollection("atlassianHost") > db.createCollection("widgets") > db.createCollection("widgetsCategory")

after collection created successfully now insert data for widgets and widgetsCategory collection

db.widgets.insert([ { "_id" : ObjectId("60989ea93ab973272e28e49f"), "id" : "60989-ea93ab9-73272e-28e49f", "title" : "Stories & Defects", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the status of all the stories and defects created", "categoryId" : [ 1 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26738691/Overview+-+Stories+and+Bugs", "widgetName" : "JiraBugs", "widgetValue" : "CD-001", "cols" : "6", "defaultStatus" : false }, { "_id" : ObjectId("60989ea93ab973272e28e4a2"), "id" : "60989-ea93ab-973272e-28e4a2", "title" : "Commits", "icon" : "https://app.dev.conceptsnbeyond.com/193a28c2d663ba32033cf5c820f06e72.png", "active" : true, "description" : "Displays a line chart showing the number of commits per day and a bar chart showing number of commits per developer", "categoryId" : [ 2 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869838/Overview+-+Commits", "widgetName" : "SCMCommitsView", "widgetValue" : "CD-004", "cols" : "6", "defaultStatus" : false }, { "_id" : ObjectId("60989ea93ab973272e28e4a5"), "id" : "60989-ea93ab-973272-e28e4a5", "title" : "Pull Request", "icon" : "https://app.dev.conceptsnbeyond.com/d14e77925e32eed1b5ff17c45bff05d7.png", "active" : true, "description" : "Displays a bar chart showing the number of pull request per day and a pie chart showing number of commits per developer ", "categoryId" : [ 2, 4, 5, 6 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26771504/Overview+-+Pull+Requests", "widgetName" : "PullRequest", "widgetValue" : "CD-003", "cols" : "6", "defaultStatus" : false }, { "_id" : ObjectId("60989ea93ab973272e28e4a8"), "id" : "60989ea-93ab973-272e2-8e4a8", "title" : "Builds", "icon" : "https://app.dev.conceptsnbeyond.com/94279ade7f6a419c5307bc048dbaded4.png", "active" : true, "description" : "Display the sprint goal, a lighthouse guiding the team to focus on getting their goal", "categoryId" : [ 2, 4, 5, 6 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26804295/Overview+-+Builds", "widgetName" : "Pipeline", "widgetValue" : "CD-005", "cols" : "6", "defaultStatus" : false }, { "_id" : ObjectId("609a2fc2d50380b5b59025da"), "id" : "609a2f-c2d503-80b5b5-9025da", "title" : "Release Burnup", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays number of planned versus actual stories delivered during each of the releases", "categoryId" : [ 1 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/21889237/Release+Burn+Up+view", "widgetName" : "ReleaseBurnup", "widgetValue" : "CD-002", "cols" : "12", "defaultStatus" : false }, { "_id" : ObjectId("609a300ed50380b5b59025f0"), "id" : "609a300-ed5038-0b5b59-025f0", "title" : "Epic Component View", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the list of the stories linked to epics or components and their statuses", "categoryId" : [ 1 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/21954761/Epic+and+Component+Burn+Down+grid+view", "widgetName" : "EpicComponentView", "widgetValue" : "CD-003", "cols" : "12", "defaultStatus" : false }, { "_id" : ObjectId("609a306ad50380b5b5902605"), "id" : "609a306-ad50380-b5b59-02605", "title" : "Sonar TimeLine", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the line graph showing the code quality and test coverage overtime", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869908/Overview+-+Code+Quality+and+Test+Coverage+Timeline", "widgetName" : "TrendSonarTimeLine", "widgetValue" : "CD-008", "cols" : "12", "defaultStatus" : false }, { "_id" : ObjectId("609dd8d93f263718b3f608c7"), "id" : "609dd8-d93f2-63718b-3f608c7", "title" : "Current Sprint", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the details of the active sprint", "categoryId" : [ 1 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26738691/Overview+-+Stories+and+Bugs", "widgetName" : "CurrentSprints", "widgetValue" : "CD-009", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609e6e0b3f263718b3f6b452"), "id" : "609e6e-0b3f263-718b3-f6b452", "title" : "Story Status", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the status of the stories", "categoryId" : [ 1 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26738691/Overview+-+Stories+and+Bugs", "widgetName" : "StoryStatus", "widgetValue" : "CD-010", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609ead593f263718b3f6fdce"), "id" : "609ead-593f263-718b3-f6fdce", "title" : "Defect Status", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the status of the defects", "categoryId" : [ 1 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26738691/Overview+-+Stories+and+Bugs", "widgetName" : "DefectStatus", "widgetValue" : "CD-011", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609f21b13f263718b3f707dc"), "id" : "609f21-b13f26-3718b3-f707dc", "title" : "% Work Completion", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the status of stories and defects closed", "categoryId" : [ 1 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26738691/Overview+-+Stories+and+Bugs", "widgetName" : "WorkCompletion", "widgetValue" : "CD-012", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609f4c6a3f263718b3f7a738"), "id" : "609f4c6-a3f2637-18b3f-7a738", "title" : "Work Priority", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the priority of stories and defects", "categoryId" : [ 1 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26738691/Overview+-+Stories+and+Bugs", "widgetName" : "WorkPriority", "widgetValue" : "CD-013", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609f5de73f263718b3f7bfc4"), "id" : "609f5d-e73f26-3718b-3f7bfc4", "title" : "Velocity", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the number of stories and defects closed during the selected dashboard timeframe, this week and today", "categoryId" : [ 1 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26738691/Overview+-+Stories+and+Bugs", "widgetName" : "Velocity", "widgetValue" : "CD-014", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609f627e3f263718b3f7c9bd"), "id" : "609f62-7e3f2637-18b3f7-c9bd", "title" : "Total Commits", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the total commits done during the selected dashboard timeframe, the current week and today.", "categoryId" : [ 2, 4 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869838/Overview+-+Commits", "widgetName" : "Commits", "widgetValue" : "CD-015", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609f6c4d3f263718b3f7ddea"), "id" : "609f6c-4d3f263-718b3-f7ddea", "title" : "Last Build Status", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the status of the last build", "categoryId" : [ 2, 4, 5, 6 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869838/Overview+-+Commits", "widgetName" : "LastBuildStatus", "widgetValue" : "CD-016", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609fa8403f263718b3f804a2"), "id" : "609f6c-4d3f263-718b3-f7ddea", "title" : "Total Builds", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays total builds and successful build runs during the selected dashboard timeframe, this week and today", "categoryId" : [ 2, 3, 4, 5, 6 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26804295/Overview+-+Builds", "widgetName" : "TotalBuilds", "widgetValue" : "CD-017", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609fad603f263718b3f814eb"), "id" : "609fad-603f2-63718b-3f814eb", "title" : "Pull Requests Status", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the status of all the pull requests created", "categoryId" : [ 2, 3 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "PullRequestsStatus", "widgetValue" : "CD-018", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609fb72b3f263718b3f82398"), "id" : "609fb7-2b3f2-63718b3-f82398", "title" : "Ratings", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays Sqale Rating, Reliability, Maintainability and Security ratings from associated code quality application", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "Ratings", "widgetValue" : "CD-019", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609fba7e3f263718b3f828de"), "id" : "609fba7-e3f263-718b3-f828de", "title" : "Test Coverage", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays total test coverage %, new coverage % and total unit tests ran", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "TestCoverage", "widgetValue" : "CD-020", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609fc26d3f263718b3f82db2"), "id" : "609fc-26d3f2-63718b3-f82db2", "title" : "Code Quality Issues - Severity", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the severity of issues uncovered, such as blockers, critical etc. during code tests", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "CodeQualityIssuesSeverity", "widgetValue" : "CD-021", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("609fd1303f263718b3f84ee7"), "id" : "609fd1-303f26-3718b3-f84ee7", "title" : "Code Quality Projects", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the project for which code quality was measured, its version, when was it last analyzed and its Quality Gate rating", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "SonarProjects", "widgetValue" : "CD-022", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("60a0861c3f263718b3f878dc"), "id" : "609f62-7e3f2637-18b3f7-c9bd", "title" : "Latest Commits", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the details of the commits done in terms of who did the commit and when", "categoryId" : [ 2, 3 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869838/Overview+-+Commits", "widgetName" : "LatestCommits", "widgetValue" : "CD-024", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("60a08c673f263718b3f88502"), "id" : "609f62-7e3f2637-18b3f7-c9bd", "title" : "Latest Builds", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the details of the builds ran in terms of who ran the build, its status and when was it run ", "categoryId" : [ 2, 3, 4, 5, 6 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26804295/Overview+-+Builds", "widgetName" : "LatestBuilds", "widgetValue" : "CD-025", "cols" : "4", "defaultStatus" : true }, { "_id" : ObjectId("60a081ff3f263718b3f872c2"), "id" : "609fd1-303f26-3718b3-f84ee7", "title" : "Workload Distribution", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the status of work items per assignee", "categoryId" : [ 1 ], "HelpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26738691/Overview+-+Stories+and+Bugs", "widgetName" : "WorkloadDistribution", "widgetValue" : "CD-023", "cols" : "8", "defaultStatus" : true }, { "_id" : ObjectId("60a1e41fe00a750ef9b5f10f"), "id" : "60a1e-41fe00-a750ef-9b5f10f", "title" : "Commits Heat Map View", "icon" : "https://app.dev.conceptsnbeyond.com/866fcb2b4ffa13a0a4b94109dedaf0c3.png", "active" : true, "description" : "Displays the heat map view of all the commits done, number of inserts, deletes and files changed", "categoryId" : [ 2, 3 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/34701313/Commits+-+Heat+Map+view", "widgetName" : "TrendCommit", "widgetValue" : "CD-026", "cols" : "12", "defaultStatus" : false }, { "_id" : ObjectId("6123d90950a6d11ea496b71b"), "id" : "49481a91-28cb-4cff-b669-bc0d7b7accc9", "title" : "Code Reliability", "icon" : "https://app.dev.conceptsnbeyond.com/193a28c2d663ba32033cf5c820f06e72.png", "active" : true, "description" : "Displays existing bugs, new bugs uncovered during Code Reliability tests and also Code Reliability rating", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "CodeReliability", "widgetValue" : "CD-028", "cols" : "4", "defaultStatus" : false }, { "_id" : ObjectId("6123d90a50a6d11ea496b729"), "id" : "c45f950d-4370-4c58-8cb2-5a158aba1726", "title" : "Code Maintainability", "icon" : "https://app.dev.conceptsnbeyond.com/193a28c2d663ba32033cf5c820f06e72.png", "active" : true, "description" : "Displays existing code smells, new code smells uncovered during Code Maintainability tests and also Code Maintainability rating", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "CodeMaintainability", "widgetValue" : "CD-030", "cols" : "4", "defaultStatus" : false }, { "_id" : ObjectId("6123d90a50a6d11ea496b735"), "id" : "531f6650-a1bb-4d28-a9c5-4ca6d7766f97", "title" : "Code Security", "icon" : "https://app.dev.conceptsnbeyond.com/193a28c2d663ba32033cf5c820f06e72.png", "active" : true, "description" : "Displays existing vulnerabilities, new vulnerabilities found during Code Security tests and also Code Security rating", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "CodeSecurity", "widgetValue" : "CD-031", "cols" : "4", "defaultStatus" : false }, { "_id" : ObjectId("6123d90a50a6d11ea496b73f"), "id" : "63979f86-129a-4d4e-a71e-e96c171dc9bc", "title" : "Code Quality Issues", "icon" : "https://app.dev.conceptsnbeyond.com/193a28c2d663ba32033cf5c820f06e72.png", "active" : true, "description" : "Displays existing issues, new issues and complexities uncovered during code tests", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "CodeQualityIssues", "widgetValue" : "CD-032", "cols" : "4", "defaultStatus" : false }, { "_id" : ObjectId("6123d90b50a6d11ea496b748"), "id" : "eafa3de0-b278-475a-b4da-30a4d9555184", "title" : "Code Size", "icon" : "https://app.dev.conceptsnbeyond.com/193a28c2d663ba32033cf5c820f06e72.png", "active" : true, "description" : "Displays number of lines of code, functions and classes of the code / project under tests", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "CodeSize", "widgetValue" : "CD-034", "cols" : "4", "defaultStatus" : false }, { "_id" : ObjectId("6123d90b50a6d11ea496b74e"), "id" : "ac9e6886-5cf4-4810-9aab-934bba14ebe8", "title" : "Code Documentation", "icon" : "https://app.dev.conceptsnbeyond.com/193a28c2d663ba32033cf5c820f06e72.png", "active" : true, "description" : "Displays percentage of documentation, number of comment lines and public APIs of the code / project being analyzed", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "CodeDocumentation", "widgetValue" : "CD-035", "cols" : "4", "defaultStatus" : false }, { "_id" : ObjectId("6123d90b50a6d11ea496b75e"), "id" : "380af96c-6885-463f-8a5d-ebe85dc2ef27", "title" : "Code Duplication", "icon" : "https://app.dev.conceptsnbeyond.com/193a28c2d663ba32033cf5c820f06e72.png", "active" : true, "description" : "Displays percentage of duplications, number of duplicated blocks and duplicated lines found in the code / project being analyzed", "categoryId" : [ 7 ], "helpUrl" : "https://ataglance.atlassian.net/wiki/spaces/AG/pages/26869902/Overview+-+Code+Quality", "widgetName" : "CodeDuplication", "widgetValue" : "CD-036", "cols" : "4", "defaultStatus" : false } ])
db.widgetsCategory.insert([ { "_id" : ObjectId("60989c503ab973272e28e3b9"), "wid" : 0, "name" : "All", "icon" : "https://app.dev.conceptsnbeyond.com/6f9682cfc34bd25055004ee556f8bcf5.png", "active" : true }, { "_id" : ObjectId("60989c793ab973272e28e3d0"), "wid" : 1, "name" : "Jira", "icon" : "https://app.dev.conceptsnbeyond.com/dd5c7b27d2fd600b55352648c15aa89e.png", "active" : false }, { "_id" : ObjectId("60989c793ab973272e28e3d3"), "wid" : 2, "name" : "BitBucket", "icon" : "https://app.dev.conceptsnbeyond.com/5fcd4d176a9aafda4f6ea74427ad4074.png", "active" : false }, { "_id" : ObjectId("60989c793ab973272e28e3d6"), "wid" : 7, "name" : "Sonar", "icon" : "https://app.dev.conceptsnbeyond.com/754e037f75c990d49efd82f241815ab1.png", "active" : false }, { "_id" : ObjectId("60989c793ab973272e28e3d9"), "wid" : 4, "name" : "Travis CI", "icon" : "https://app.dev.conceptsnbeyond.com/f13a06050ce4406c6670622344a70dad.png", "active" : false }, { "_id" : ObjectId("60989c793ab973272e28e3dc"), "wid" : 5, "name" : "Codeship", "icon" : "https://app.dev.conceptsnbeyond.com/399ca14e46b780780a8f34f900cac4bf.png", "active" : false }, { "_id" : ObjectId("60989c793ab973272e28e3df"), "wid" : 6, "name" : "Jenkins", "icon" : "https://app.dev.conceptsnbeyond.com/a0f6aa3bd1c49f11fa281b20761c7783.jpg", "active" : false }, { "_id" : ObjectId("60a1e69fe00a750ef9b5f266"), "wid" : 3, "name" : "GitHub", "icon" : "https://app.dev.conceptsnbeyond.com/f13a06050ce4406c6670622344a70dad.png", "active" : false } ])

After all steps completed. Now exits for mongo command line and restart the mongo server using by

> exit sudo systemctl restart mongod

 

2. Using by docker

Run MongoDB with Docker Composer

Run MongoDB with Docker Composer

  • Create Docker mongo-compose.yml file and paste below code

    # mongo-compse.yml version: "3" services: mongodb: image: mongo container_name: mongodb ports: - 27017:27017 environment: - MONGO_INITDB_ROOT_USERNAME=rootuser - MONGO_INITDB_ROOT_PASSWORD=rootpass volumes: - mongodb-data mongo-express: image: mongo-express container_name: mongo-express ports: - 8081:8081 environment: - ME_CONFIG_MONGODB_ADMINUSERNAME=rootuser - ME_CONFIG_MONGODB_ADMINPASSWORD=rootpass - ME_CONFIG_MONGODB_SERVER=mongodb networks: default: name: mongo-express-network volumes: mongodb-data: driver: local
  • and after that locate the saved directory and open AWS CLI command line

  • execute the docker compose command

    docker-compose -f mongo-compse.yml up -d
  • after successfully execution code. Find the expressed url like and visit http://swarm-ip:8081, http://localhost:8081, or http://host-ip:8081 (as appropriate).

  • Create Master Database and download the json files.

  • Execute the import commands

    mongoimport --db master --collection atlassianHost mongoimport --db dbName --collection widgets --file widgets.json mongoimport --db dbName --collection widgetsCategory --file widgetsCategory.json
  • Completed the steps