numberofMoons are set to null

After switching to the aggregatations db, I execute the following:
db.solarSystem.find({}, {_id: 0, numberofMoons:1})
The query returns the following:
{ }
{ }
{ }
{ }
{ }
{ }
{ }
{ }
{ }

When I run the same command, my output does NOT produce the same type of results as seen in the video. I get this:
MongoDB Enterprise Cluster0-shard-0:PRIMARY> db.solarSystem.find({}, {_id: 0, name: 1, numberofMoons: 1}).pretty()
{ “name” : “Uranus” }
{ “name” : “Mercury” }
{ “name” : “Earth” }
{ “name” : “Jupiter” }
{ “name” : “Venus” }
{ “name” : “Mars” }
{ “name” : “Sun” }
{ “name” : “Saturn” }
{ “name” : “Neptune” }

When the video shows an output similar to this:
{
“name”: “Jupiter”,
“numberofMoons”: 67
}
{
“name”: “Saturn”,
“numberofMoons”: 62
}

Should my numberofMoons be set to null?

I would try with numberOfMoons.

Thanks! Simple typo which I did not see. I’m now getting the expected output.

1 Like