I have a bunch of JSON files (say a.json, b.json, c.json). I know I can import each of them into a MongoDB collection using
mongoimport -d db -c collection --file x.json --jsonArray
And my collection will contain the three jsons. But I'd like to have the jsons be the values to keys which identify them. That is, instead of having my collection contain the following:
a.json, b.json, c.json
I'd like:
{ "a" : a.json }, { "b" : b.json }, { "c" : c.json }
Is there some functionality in Mongo's insert() method like: db.collection.insert( { "a" : a.json } ) ?