This question isn’t specifically related to any course related work but more to a bit of confusion I have come up against.
I was reading the documentation on aggregation and came to the examples section that has you import a zip codes collection and attempted this on my personal machine.
My setup is
MongoDB server version: 4.0.5 and I have a 3 member replica set. I can successfully import the data without problem and can perform basic queries on the collection. The issues comes when I attempt to run the aggregate command it suggests in the documentation, here, and I receive the error message:
"The 'cursor' option is required, except for aggregate with the explain argument"
I actually brought up this issue while in the MongoDB Performance course and just kind of went with it after we couldn’t figure out why I was being required to use the cursor option. Now though, I am faced with this same issue, and thought someone in the aggregation course may be a bit more familiar with why this is happening. I can’t find anywhere in the documentation that states that this is required for version 4.0, and it appears there are two separate sections for commands, Database and shell methods. The course appears to be using the commands that align with the shell methods, and just reading the docs that seems to be correct as well. Based on the docs I am stumped as to why I keep getting this cursor required message when aggregating on my local
4.0.5 replica set. I even switched to the 4.2 version of the docs and it still shows the
cursor option as optional in the shell command section.
Is there some way that I am being forced to submit Database commands instead of shell methods, perhaps? Anyway to change that? Any feedback would be appreciated because this is pretty confusing, for me.