How to view how many pieces of data in a collection of mongodb

  mongodb, question

How to view how many pieces of data in a collection of mongodb

What statement can be checked?

db.getCollection('collection').count()