I have 2 collections in my database
MongoDB Enterprise> show collections
mycoll1
mycoll2
I want to pass these names to a variable say c1 and use values of this array in mongodb shell commands (here getting counts from collections). what I'm doing now is:
MongoDB Enterprise> for (var i in c1) { db.getCollection((c1[i])).find().count()}
but in output I'm getting only second collections count and not first one.
I'm new to javascrip: please suggest.