How to count documents of a collection in MongoDB

Today, I had to do this at work. turns out it is very easy. I am using Robomongo 1.0-RC1. I just double click on the collection that I want, in this case knives and I just execute the following query:

db.getCollection('knives').count()

The result in my case is:

1911

Hope it helps!

Sources

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.