Insert multiple text files into mongo

You may write a script that creates a .json document and then you may import this document or integrate it to a .js script.

Untested bashscript (will fail with files with single or double quotes) :

echo “{”
echo " ‘my-first-file:’"
echo -n " ‘"
cat my-first-file
echo -n "’,"
echo " ‘my-2nd-file:’"
echo -n " ‘"
cat my-2n-file
echo -n "’,"

echo “}”