Is there a difference between $addFields and $project when using certain operators? (I searched for an answer on Google and Stack Overflow and the MongoDB Manual but couldn’t find one, so I thought I’d ask my question here.)
My situation: I was completely stumped; I kept receiving null values for scaled_votes and normalized_rating when using the formulas provided in the handout inside of $addFields. I removed $addFields and used both formulas inside $project while troubleshooting and, suddenly, I received proper values and was able to complete the lab.
To clarify, I used two addFields (one for scaled_votes and one for normalized_rating), hard-coded the values from the handout, and referenced imdb.votes and later scaled_votes using (i.e., $imdb.votes).