Stuck on working with the shell

So I have Atlas and Mongodb on my Mac as well. Started mongod and launched the shell. I get the output for show dbs and show collections as expected. BUT when I try to run a query, I get nothing. From the following:

MongoDB Enterprise Cluster0-shard-0:PRIMARY> aggregations.movies.find({ "imdb.rating" : { $gt: 6 }})

`2019-01-10T20:24:59.103-0500 E QUERY [thread1] ReferenceError: aggregations is not defined :

@(shell):1:1`

MongoDB Enterprise Cluster0-shard-0:PRIMARY> movies.find({ "imdb.rating" : { $gt: 6 }})

`2019-01-10T20:25:29.580-0500 E QUERY [thread1] ReferenceError: movies is not defined :

@(shell):1:1`

MongoDB Enterprise Cluster0-shard-0:PRIMARY> { "imdb.rating" : { $gt: 6 }}

2019-01-10T20:47:15.766-0500 E QUERY [thread1] SyntaxError: missing ; before statement @(shell):1:16

MongoDB Enterprise Cluster0-shard-0:PRIMARY>

The last work on Compass though so clearly its not a connectivity issue.

Probably some noob oversight on my part. Thanks in advance for your help.

Best,

Sandeep

The syntax is db.CollectionName.find …. You specify the database you want to use with use DatabaseName.

1 Like

@Santosh_97355, you are really really unclear on the concept: