MongoDB: find execution time for count() command on millions of records in a collection?
问题 I am trying to find time required to perform a count() on a collection which is consisting of millions of testdata records, with following scenario:- 1) From 1st Mongo shell I am inserting millions of records into collection using a code for (var i = 0; i < 10000000; ++i){ db.unicorns.insert({name: 'sampleName', gender: 'm', weight: '440' }); } 2) From 2ndMongo shell I am trying to find count() on that collection( Imp: while insertion is still getting executed on 1st Mongo Shell) db.unicorns