M001 Chapter 5, Lecture 1: Awkward passage

This is my first post about these courses, so let me start with kudos. This is a very informative course. I have already used MongoDB in a project, but was struggling with more complex objectives. I’m looking to this course to provide the basic understanding of the MQL and related syntaxes. So far, so good.

Listening to the first video in Chapter 5, I found this passage (highlighted in bold) super awkward:
05:25 “Here, we’re creating another field for the documents that are created in the pipeline, and we’re calling this field count. Then, we’re using the $sum operator, in which case the value of the $price field in each document for a given group criteria will be added to the total value to the total for that group. In our case we’re simply adding the number one for each document that falls into each group.”

“price field in each document” ??!?!
This is super confusing, since price has nothing to do with the stated objective, How many listing does each country have?

I’m also trying to understand the way _id is used. I know it’s required to be unique in each document. I’m getting the idea each stage returns data in the form of a cursor. Then explicitly setting _id to the value you wish to group creates a new set of documents with the _id value for each member of the group. Or something like that. Maybe that should be stated more clearly. The syntax mentions an ‘aggregator’ (which I guess would be _id), but I didn’t catch that explanation.

Hi @xtian_simon, welcome to the community.
Thank you for your feedback. I will forward this to the appropriate team and our engineers will make the required changes(if any) to make it clearer and easier to understand.

In case you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.