How to use mongoexport in count?
I created a sample.js file like the sample below:
db=db.getSiblingDB('DbName');

printjson( db.getCollection('CollectionName').find().count() );

then I run this script below on cmd:
mongo --host IP:PORT --username username --password password --authenticationDatabase admin --quiet sample.js &gt; sample.csv