#mongodb
#database
#nrdb
#master-in-software-engineering
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.
- Install MongoDB Community version engine locally from here.
- Record your queries on a .js file.
- Document your process on the README.md.
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.
Go to the official MongoDB website and download the Community version of the engine from here.
Execute the installer.
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
Execute MongoDB queries for the following operations
-
Insert at least 3 authors with the following fields
- Name: String
- Last name: String
- Date of Birth: Date
- Date of death: Date
- Country: String
-
Insert at least 10 books with the following fields:
- Title: String
- Release Year: [Date]
- Category: String
- Authors (id, name, lastName): [{id, name, lastName}, … ]
- Add a date of death to one Author
- Add a new release year to a book
- Change the title of a book adding (“New Edition”)
- Select all books
- Select all books for a given category
- Select all books published before 2002
- Select all books with more than one author
- Select all authors
- Select all death authors
- Select all authors born before 1990
- Select all authors from a given country
- Eliminate all the books for a given author
- Eliminate all the death authors
* MongoDB
To deliver this project you must follow the steps indicated in the document: