Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Aug 172011
 

Count the total number of objects in the collection in MongoDB

Answer:

In MongoDB, to count the total number of objects in the collection, you can use the following statement in the mongodb Interactive shell.

db.test.count()

The above statement will return the total number of objects in the collection "test"

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>