In the excersice that ask how many movies with 2 awards wind and 2 awards nomination when I typedb.movieDetails.find({"awards.wins": 2, "awards.nominations": 2}).count()
, the system returns 0 as a result. I went trough the steps until I reached the ‘use movieDetails’ step.
The mistake you have done is you typed ‘use movieDetails’
which is wrong since there is no db called movieDetails.
To Fix your problem:
We have a db called ‘video’ that has ‘movieDetails’ collections.
Try this and it should work:
- Make sure you are connected to Sandbox cluster
- type:
use video
- type your query:
db.movieDetails.find({"awards.wins": 2, "awards.nominations": 2}).count()
it should return 12
Hope it helps!
It worked as you said. Thanks.
still not working for me
Make sure you are connected to correct cluster
I think you connected to class cluster
Make sure your collection exists before you fire your find command
See the difference here:
Class:
MongoDB Enterprise Cluster0-shard-0:PRIMARY> use video
switched to db video
MongoDB Enterprise Cluster0-shard-0:PRIMARY> show collections
movies
MongoDB Enterprise Cluster0-shard-0:PRIMARY> exit
Sandbox:
MongoDB Enterprise Cluster0-shard-0:PRIMARY> use video
switched to db video
MongoDB Enterprise Cluster0-shard-0:PRIMARY> show collections
movieDetails
moviesScratch