You will design a database, populate it with a script, and perform an aggregate query
to display data from it. Your script will will saved as hw14.js.
As in the previous assignment the final script should begin with a command to
remove all data from existing collections so that each time the script is run
there is a clean starting point. The hw14.js file should be executable by
the provided mongoexec script on csci.hsutx.edu.
Suppose you are creating a database for a web-based business that serves
customers across the world. The database will need to store information about
customers, purchases, and countries. Information that must be stored or able
to be calculated by queries:
- customer name, email, phone, date of birth, location
- customer login credentials
- country name, number of customers in country, geographical borders (leave
a placeholder for this, but no need to populate it with actual coordinates),
number of outlets in country
- customer order history (date and amount of each order)
- total revenue generated by each customer and country
Your design should have more than one collection and should make appropriate use
of nested documents. After you have written a script to create and populate your
collection write an aggregate lookup query to combine your collections and
display results from them.
In Canvas, upload your final working hw14.js script that shows your design
and implementation.