It looks in the cursor-like stages lecture, for example at 4:06 in the lecture, the normal list of documents is prefixed by “result:”. When I run the same pipeline, I don’t get any “result:” above the list. What is going on?
What chapter exactly is this lecture? And what is the exact title of the lecture?
Chapter 2, course 121, lecture “curor - like stages, pt 1”
Ah! I see what you mean.
I think he’s using a different type of tool/terminal to run his commands or he’s configured the mongo shell somehow. If you notice that it returns the number of documents fetched when he does a find()
and for aggregate()
, the output are shaped as an array of documents labelled result. In addition, all his results are pretty()
without him explicitly specifying it.
That’s not the default/normal behaviour.
The result of running the query in mongo shell should look like below:
The result in lecture is formatted and printed in a way easily understandable by the users. However, I would consider this as a feedback and forward it to the concerned team since it is a bit confusing.
Thanks for the catch!!
Please let me know, if you have any questions.
Thanks,
Sonali