How to find the number of documents using smongo shell

as we know, we can find the total number of documents in “movieDetails” collections using compass; because it showing the number of docs in “movieDetails” in default view.

but is there a way we can find the number of docs in “movieDetails” using mongo shell?

maybe Mr. Shannon has taught us, may be i missed out.

if it’s not, is there any way ?

Thank You !

Sure, you can. After connecting to the database. Run this query in Mongo shell:

 db.movieDetails.count()

Kanika

1 Like

Thanks for the answer !