ReferenceError: db is not defined

Hi,

When I open a mongo shell and type in

db.people.count({ “email” : {"$exists": 1} })

I get this error

ReferenceError: db is not defined

I’m not sure how to fix this. I’m guessing it has something to do with my path?

Any help will be greatly appreciated.

Most likely you are not connected to DB

vagrant@m103:~/data$ mongo --nodb
MongoDB shell version v3.6.9

db
2019-02-19T10:13:40.402+0000 E QUERY [thread1] ReferenceError: db is not defined :
@(shell):1:1