Unable to get count() of movieDetails in terminal window


Judging by the hostname, you are connecting to the shared M001 example server. That one does not have video.movieDetails, only video.movies.

Video.movieDetails will be built on your private MongoDB cluster, which is NOT a shared server.

Of course, db.movies.count() should have given some result. So, basic troubleshooting!

show dbs
show collections
db.runCommand({“connectionStatus” : 1})

I’ve spotted your mistake: you’re in the wrong database. You’re in “videoS”, not “video”.

Remember! If a database does not exist yet and you call it, then MongoDB will quietly make it :wink: So by doing “use videos” you just created an empty database.


Thank you, now that worked !!:grinning:

1 Like