Sign inSign up

kcornwall/mongodbtestdata

By kcornwall

•Updated almost 3 years ago

Image
0

793

kcornwall/mongodbtestdata repository overview

⁠MongoDB Seeded Database

This image has been set up to provide various data collections to allow you to access and practice against a seeded, local MongoDB instance. The MongoDB instance is not password protected and merely meant for training purposes.

⁠Running the container

The below snippet will get the container up and running locally:

docker run -d --name <name_your_container> -p 27017:27017 kcornwall/mongodbtestdata

⁠docker-compose

services:

  mongo:
    image: kcornwall/mongodbtestdata
    restart: always
    ports:
      - 27017:27017

  mongo-express:
    image: mongo-express
    restart: always
    ports:
      - 8081:8081
    environment:
      ME_CONFIG_MONGODB_URL: mongodb://mongo:27017/
      ME_CONFIG_MONGODB_ENABLE_ADMIN: 'true'

⁠Connecting to the DB

The DB credentials are as below:

  • Username = root
  • password = password

⁠MongoDB filter queries

The documentation at mongodb.com/docs/manual/tutorial/query-documents/⁠ are a great place to start learning about filter queries.

⁠Available collections

At the moment there are 4 different databases that contain collections:

Both the student_data and user_details the data has been randomly generated. The imdb and quiz data have been taken from public sources.

⁠IMDB Data Structure
 {
  "title": "Avatar",
  "score": 7.9,
  "year": "2009",
  "duration": 178,
  "rating": "PG-13",
  "budget": 237000000,
  "genres": [
    "Action",
    "Adventure",
    "Fantasy",
    "Sci-Fi"
  ],
  "gross": 760505847,
  "director": "James Cameron",
  "actors": [
    "CCH Pounder",
    "Joel David Moore",
    "Wes Studi"
  ],
  "language": "English",
  "country": "USA"
}

⁠Quiz Data Structure

IMPORTANT NOTE - there are many areas within the data with unicode in place of certain characters. These are in place on purpose to practice data transformation.

{
      "category": "Entertainment: Video Games" ,
      "type": "multiple" ,
      "difficulty": "easy" ,
      "question": "What is the name of &quot;Team Fortress 2&quot; update, in which it became Free-to-play?" ,
      "correct_answer": "&Uuml;ber Update" ,
      "incorrect_answers": [
        "Pyromania Update" ,
        "Mann-Conomy Update" ,
        "Engineer Update"
      ]
    }
⁠User data structure
{
  "id": 1,
  "first_name": "Flory",
  "last_name": "Boffey",
  "email": "[email protected]",
  "company_name": "Lind Inc",
  "company_city": "Askiz",
  "job_title": "Information Systems Manager",
  "linkedIn_skill": "Access Control"
}
⁠Student details data structure
{
  "first_name": "kara",
  "last_name": "darcey",
  "gender": "Gender Fluid",
  "email": "[email protected]",
  "phone_number": "+447774443947",
  "current_status": "In Post Graduate Study",
  "university": "Aberystwyth University",
  "graduation_year": "2020",
  "degree": "business and tourism management with foundation year london",
  "visa": "No"
}

Tag summary

Content type

Image

Digest

sha256:b17a9f876…

Size

246.9 MB

Last updated

almost 3 years ago

docker pull kcornwall/mongodbtestdata