Node.js, Express, Nunjucks, MongoDB, and Mongoose There are a couple of programs similar to this assignment given in the lecture notes for the week that discusses CRUD operations. Specifically, the Admin example and the CIT301 example both have index.js code and nunjucks code similar to this assignment. You may find some of the other example programs useful as well. It would ultimately save you time if you have already studied these programs before giving this assignment a shot. Either way, hopefully you'll start early and you've kept to the schedule in terms of reading the lecture notes. You will need to create a database named travel using compass, then create a collection named trips. Use these names; your code must work with my database. The trips documents should then be imported unto the trips collection by importing the JSON file containing all the data as linked below. The file itself is named trips.json, and is available on the course website in the same folder as this assignment. You will need to unzip it before importing it into compass. The following video discusses how to get the data and offers an overview of how all this should work. I recommend looking at this video before anything else. click YouTube here Video Html forms Program 5 hint video You don't necessarily need to import any data. The add trip data option in your program will allow you to add new data one record (document) at a time. But know how to add a backup file to your database is a good thing to know. The database in the example has 38-ish records, and the first two look like the following after being imported into Compass. Note miles per gallon is not a field in the schema, but will be calculated from the miles property divided by the gallons property, calculated as a virtual field. The date, which is stored as a string data type, has a specific format: yyyy-mm-dd. So for February 6th, 2017 it would be 2017-02-06. ✓ ADD DATA ▾ VIEW 0 _id: ObjectId("5bd7335b802c8e1cd8aa7b29") driver: "andy" date: "2017-02-06" city: "chicago" miles: 700 gallons: 27 _id: ObjectId("5bd7335b802c8e1cd8aa7b2b") driver: "barb" date: "2017-03-14" city: "nashville" miles: 399 gallons: 14.1 The date property should be unique and of type String, not type Date. Program Interface Use express, nunjucks, mongoose, and body-parser. npm install express mongoose nunjucks body-parser --save Your program should work with my db, meaning the mongoose model must match mine. Your templates do not have to display things precisely like mine, but they should display the same information in a reasonable form. In your model, the db must be named travel, the collection must be named trips. We will assume only one trip a day, so the date field must be a String, required, and unique, and use the format yyyy-mm-dd. The date field is how we tell the documents apart. In the model, miles and gallons need to be of type Number. Using my db and your program, I should be able to display all the records with an option to edit each document. the edit page should display the data and clicking a button or link should show an initially hidden text box allowing miles and or gallons to be edited and updated in the db ⚫ I should be able to filter the collection by city name using a drop-down list with the option to edit a record for miles and gallons. . Use Bootstrap for styling, especially the nav bar. You need to be able to add a new trip Use a main layout that holds the nav bar your model will need a virtual field that calculates and returns the mpg field. No fair storing the mpg value in the db itself.
Node.js, Express, Nunjucks, MongoDB, and Mongoose There are a couple of programs similar to this assignment given in the lecture notes for the week that discusses CRUD operations. Specifically, the Admin example and the CIT301 example both have index.js code and nunjucks code similar to this assignment. You may find some of the other example programs useful as well. It would ultimately save you time if you have already studied these programs before giving this assignment a shot. Either way, hopefully you'll start early and you've kept to the schedule in terms of reading the lecture notes. You will need to create a database named travel using compass, then create a collection named trips. Use these names; your code must work with my database. The trips documents should then be imported unto the trips collection by importing the JSON file containing all the data as linked below. The file itself is named trips.json, and is available on the course website in the same folder as this assignment. You will need to unzip it before importing it into compass. The following video discusses how to get the data and offers an overview of how all this should work. I recommend looking at this video before anything else. click YouTube here Video Html forms Program 5 hint video You don't necessarily need to import any data. The add trip data option in your program will allow you to add new data one record (document) at a time. But know how to add a backup file to your database is a good thing to know. The database in the example has 38-ish records, and the first two look like the following after being imported into Compass. Note miles per gallon is not a field in the schema, but will be calculated from the miles property divided by the gallons property, calculated as a virtual field. The date, which is stored as a string data type, has a specific format: yyyy-mm-dd. So for February 6th, 2017 it would be 2017-02-06. ✓ ADD DATA ▾ VIEW 0 _id: ObjectId("5bd7335b802c8e1cd8aa7b29") driver: "andy" date: "2017-02-06" city: "chicago" miles: 700 gallons: 27 _id: ObjectId("5bd7335b802c8e1cd8aa7b2b") driver: "barb" date: "2017-03-14" city: "nashville" miles: 399 gallons: 14.1 The date property should be unique and of type String, not type Date. Program Interface Use express, nunjucks, mongoose, and body-parser. npm install express mongoose nunjucks body-parser --save Your program should work with my db, meaning the mongoose model must match mine. Your templates do not have to display things precisely like mine, but they should display the same information in a reasonable form. In your model, the db must be named travel, the collection must be named trips. We will assume only one trip a day, so the date field must be a String, required, and unique, and use the format yyyy-mm-dd. The date field is how we tell the documents apart. In the model, miles and gallons need to be of type Number. Using my db and your program, I should be able to display all the records with an option to edit each document. the edit page should display the data and clicking a button or link should show an initially hidden text box allowing miles and or gallons to be edited and updated in the db ⚫ I should be able to filter the collection by city name using a drop-down list with the option to edit a record for miles and gallons. . Use Bootstrap for styling, especially the nav bar. You need to be able to add a new trip Use a main layout that holds the nav bar your model will need a virtual field that calculates and returns the mpg field. No fair storing the mpg value in the db itself.
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 16PE:
The implementation of a queue in an array, as given in this chapter, uses the variable count to...
Related questions
Question

Transcribed Image Text:Node.js, Express, Nunjucks, MongoDB, and Mongoose
There are a couple of programs similar to this assignment given in the lecture
notes for the week that discusses CRUD operations. Specifically, the Admin
example and the CIT301 example both have index.js code and nunjucks code
similar to this assignment. You may find some of the other example programs
useful as well. It would ultimately save you time if you have already studied
these programs before giving this assignment a shot. Either way, hopefully
you'll start early and you've kept to the schedule in terms of reading the lecture
notes.
You will need to create a database named travel using compass, then create a
collection named trips. Use these names; your code must work with my
database. The trips documents should then be imported unto the trips collection
by importing the JSON file containing all the data as linked below. The file itself
is named trips.json, and is available on the course website in the same folder as
this assignment. You will need to unzip it before importing it into compass.
The following video discusses how to get the data and offers an overview of how
all this should work. I recommend looking at this video before anything else.
click YouTube
here Video
Html forms
Program 5 hint video
You don't necessarily need to import any data. The add trip data option in your
program will allow you to add new data one record (document) at a time. But
know how to add a backup file to your database is a good thing to know.
The database in the example has 38-ish records, and the first two look like the
following after being imported into Compass. Note miles per gallon is not a field
in the schema, but will be calculated from the miles property divided by the
gallons property, calculated as a virtual field. The date, which is stored as a
string data type, has a specific format: yyyy-mm-dd. So for February 6th, 2017
it would be 2017-02-06.
✓ ADD DATA ▾
VIEW
0
_id: ObjectId("5bd7335b802c8e1cd8aa7b29")
driver: "andy"
date: "2017-02-06"
city: "chicago"
miles: 700
gallons: 27
_id: ObjectId("5bd7335b802c8e1cd8aa7b2b")
driver: "barb"
date: "2017-03-14"
city: "nashville"
miles: 399
gallons: 14.1
The date property should be unique and of type String, not type Date.
Program Interface

Transcribed Image Text:Use express, nunjucks, mongoose, and body-parser.
npm install express mongoose nunjucks body-parser --save
Your program should work with my db, meaning the mongoose model
must match mine. Your templates do not have to display things precisely
like mine, but they should display the same information in a reasonable
form.
In your model, the db must be named travel, the collection must be
named trips.
We will assume only one trip a day, so the date field must be a String,
required, and unique, and use the format yyyy-mm-dd. The date field is
how we tell the documents apart.
In the model, miles and gallons need to be of type Number.
Using my db and your program, I should be able to display all the records
with an option to edit each document.
the edit page should display the data and clicking a button or link should
show an initially hidden text box allowing miles and or gallons to be
edited and updated in the db
⚫ I should be able to filter the collection by city name using a drop-down list
with the option to edit a record for miles and gallons.
.
Use Bootstrap for styling, especially the nav bar.
You need to be able to add a new trip
Use a main layout that holds the nav bar
your model will need a virtual field that calculates and returns the mpg
field. No fair storing the mpg value in the db itself.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Recommended textbooks for you

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,