Assignments Node IX

Handing In Assignments

You must hand in by using git

Hand In by git

  • Create an empty repo on bitbucket.org, gitlab.com, or github.com,
  • git push your local repo to the above remote repo.
  • For node assignments please put the line(s)

    node_modules/

    into your .gitignore file.

Send a mail to with:

  • The word 'handin <subjectname>' in the subject line of your mail
  • The url of your repo(s).

Assignment Node IX.0

We have created a MongoDB version of the world database from MySQL. The backup is placed for your download from here.

Download it, unzip it, and install it by the procedure shown in the section called “Backup/Restore of MongoDB”.

Assignment Node IX.1

In the world database you have just downloaded and installed, you will notice two collections that were not present when you first got aquainted with the database. They are continent, and governmentform.

In the model solution shown earlier in todays material, you saw a data entry HTML5 form for country. Either in that solution, or in your own similar solution, you must, in the form change the input field for continent, and governmentform to be drop downs, ie select elements with options for the valid data. The valid data must be read from the two new collections in the world database. As a hint, take a look a the model solutions way of creating the drop down for selection of country for display.

Assignment Node IX.2

Take your site, as it looks after solving the previous assignment. And make a copy of it into another project folder. When that is done, you must refactor it so that you use mongoose for all database activity. The assignment includes writing schemas for the three involved collections continent, governmentform, and country.

Assignment Node IX.3

Here is a series of questions that you must find answers to in the world database.

  1. Create a page that shows the languages spoken in xyz (continent). The continents must be selectable by the user. Listing each language only once with the total number of speakers from all countries where the language is spoken.
  2. Create a page ranking all languages in the world on a list. Put in a count of how many different languages exist.
  3. Create a page where the user may enter a language, and receive the ranking of that particular language.
  4. Make a page grouping countries per continent.
  5. Make a page showing what cities have namesakes in other countries?

If you run out, we can easily come up with more :)