In mongodb 3.0 or above, we can specify database name to restore. Assuming that you are standing at the root directory that contains bson files
./
a.bson
b.metadata.bson
...
The script would be
for FILENAME in *; do mongorestore -d <db_name> -c "${FILENAME%.*}" $FILENAME; done
Best,