Hi, I’m tryng to list the count of documents for all colletions but my code doesn’t work:
use sample_training
for (var i = 0; i < collections.length; i++) {
print(collections[i], db.getCollection(collections[i]).countDocuments())
}
I get this error:
ReferenceError: collections is not defined
What am I doing wrong?