I would like to get the collection names list from mongo database. So, I use the following command in shell script :
collections=mongo $dbName --eval "db.getCollectionNames()"
The output result of this command is
"MongoDB shell version: 2.2.0 connecting to: cm_v2 col1,col2,col3,col4"
I would like to get only the collections name such as : col,col2,col3,col4. So, how should I delete the output like version from result.