Skip to content

Latest commit

 

History

History
executable file
·
52 lines (47 loc) · 1.49 KB

File metadata and controls

executable file
·
52 lines (47 loc) · 1.49 KB

Mongoose Lab

Create a simple terminal app that does the following. There is no express, so the app should run once, perform the actions described, in the order in which they're described, and then exit.

  1. Create a schema for a Company
    • name (string, required)
    • founded (Date)
    • employees (Number)
    • active (Boolean)
    • products (array of Strings)
    • CEO (object with below properties)
      • name (String)
      • age (Number)
  2. Create Apple
    • name: Apple
    • founded: April 1, 1976
    • employees: 2
    • active: false
    • products: ['computers']
    • CEO:
      • name: Steve Jobs
      • age: 21
  3. Create Google
    • name: Google
    • founded: September 4, 1998
    • employees: 57,100
    • active: true
    • products: ['search','maps','email']
    • CEO:
      • name: Larry Page
      • age: 43
  4. Update Apple
    • name: Apple Inc
    • founded: April 1, 1976
    • employees: 66,000
    • active: true
    • products: ['computers', 'phones', 'tablets']
    • CEO:
      • name: Time Cook
      • age: 56
  5. Find Apple
    • log its employees
  6. Find Google
    • log its employees
  7. Delete Apple
  8. Delete Google

Write the previous exercise so that creating/updating/finding/deleting apple happened "at the same time" as creating/updating/finding/deleting google. Take advantage of node's asynchronous nature!

STETCH

Try to integrate this into an express app. Have each step be its own page with a link to the next step (which is also a page)