Finalizing Part 1, excluding report

This commit is contained in:
Noah L. Schrick 2022-12-05 17:05:19 -06:00
parent e388349752
commit da34e2b6b5
5 changed files with 26 additions and 0 deletions

View File

@ -88,11 +88,37 @@ db.Project_Data.updateMany({"CustomerID" : ""}, { $unset : {"CustomerID" : 1 } }
\label{fig:after_ci_drop}
\end{figure}
Adding "HighDemand":
\begin{spverbatim}
db.Project_Data.aggregate([
{
$addFields: {
HighDemand: {
$cond: [
{ $gt: [ "$Quantity", 11 ] },
"Yes",
"$$REMOVE"
]
}
}
},
{
$out: "Project_Data"
}
]).pretty()
\end{spverbatim}
\subsection{Queries}
\textbf{Question 1:} How many records have the column “HighDemand”? (Must have a code to answer this, one way to answer this is to have a code that displays all the records except those with the column HighDemand and then subtract the number from total number of records)
\begin{spverbatim}
db.Project_Data.count({"HighDemand": "Yes"})
\end{spverbatim}
\textbf{Question 2:} Display the records with price more than 4 (4 excluded)
\begin{spverbatim}
db.Project_Data.find({"Price": {"$gt": 4}}).pretty()
\end{spverbatim}
\section{Metadata}

BIN
images/demand_count.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
images/gt_four.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

BIN
images/high_demand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB