skip to Main Content

Mongodb – Insert big json file into a mongo collection using mongosh

I need to insert a 181 KB json file into a mongo collection, the restriction is that it needs to be done using mongosh. json_file_path=/some/path/file.json json_file_string=$(cat $json_file_path) /mongo/path/monhosh $databaseName --tlsCertificateKeyFile someAuthDetails --tlsCAFile someMoreAuthDetails --quiet --eval "db.test_collection.insertOne(${json_file_string})" this seems to be…

VIEW QUESTION
Back To Top
Search