I would like to know how to count the number of documents in a collection. I tried the follow
var value = collection.count(); && var value = collecti
Since v4.0.3 you can use for better performance:
db.collection.countDocuments()