Giter Club home page Giter Club logo

mongodb-pill's Introduction

#mongodb #database #nrdb #master-in-software-engineering

MongoDB Pill

Version

The purpose of this project is to learn the basics of MongoDB for modeling, storing, retrieving and updating data.

You will need to install the database engine and work locally.

Index

Requirements

  • Install MongoDB Community version engine locally from here.
  • Record your queries on a .js file.
  • Document your process on the README.md.

Repository

First of all you must fork this project into your GitHub account.

To create a fork on GitHub is as easy as clicking the “fork” button on the repository page.

Fork on GitHub

Installing

Go to the official MongoDB website and download the Community version of the engine from here.

On Windows:

Execute the installer.

On UNIX / MacOS:

Extract the content of the tgz file and move it to a directory on your PATH system variable:

sudo cp /path/to/the/mongodb-directory/bin/* /usr/local/bin/

Check that the engine is properly installed with the following command on your teerminal

mongo --version

>> MongoDB shell version v5.0.0

Create a directory to store MongoDB Data

mkdir mongodb-data

Start the MongoDB server

mongod --dbpath mongodb-data

After some logs from the server, you should see a message like this:

{"t":{"$date":"2021-07-15T16:41:47.587+02:00"},"s":"I",  "c":"NETWORK",  "id":23016,   "ctx":"listener","msg":"Waiting for connections","attr":{"port":27017,"ssl":"off"}}

Start the database client on a diferent terminal

mongo

Create a new databse

use books

Tasks

Execute MongoDB queries for the following operations

Insert data

  1. Insert at least 3 authors with the following fields

    • Name: String
    • Last name: String
    • Date of Birth: Date
    • Date of death: Date
    • Country: String
  2. Insert at least 10 books with the following fields:

    • Title: String
    • Release Year: [Date]
    • Category: String
    • Authors (id, name, lastName): [{id, name, lastName}, … ]

Update data

  1. Add a date of death to one Author
  2. Add a new release year to a book
  3. Change the title of a book adding (“New Edition”)

Get data

  1. Select all books
  2. Select all books for a given category
  3. Select all books published before 2002
  4. Select all books with more than one author
  5. Select all authors
  6. Select all death authors
  7. Select all authors born before 1990
  8. Select all authors from a given country

DELETE DATA

  1. Eliminate all the books for a given author
  2. Eliminate all the death authors

Technologies used

* MongoDB

Project delivery

To deliver this project you must follow the steps indicated in the document:

Resources

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.