So, an individual object in res.prices is gonna be like:
{
_id: MonthlyDateObj,
value: {
low_avg: lowPrice,
mid_avg: mid,
high_avg: high,
}
}
and for res.trends its like :
{
date: MonthlyDateObj,
val: trendValue
}
and MonthlyDateObj is just a date object where only the month and year have any real significance. The day value is always set to 1 since we're doing it by month.
So, an individual object in res.prices is gonna be like: { _id: MonthlyDateObj, value: { low_avg: lowPrice, mid_avg: mid, high_avg: high, } } and for res.trends its like : { date: MonthlyDateObj, val: trendValue }
and MonthlyDateObj is just a date object where only the month and year have any real significance. The day value is always set to 1 since we're doing it by month.