The JSON files are as follows a.json,b.json.....z.json (26 json files)
The json format of each of the file looks as:
{
\"a cappella\": {
\"w
If you want to insert data from multiple .json
files, do it in a loop:
file_names = ['a.json', 'b.json', ...]
for file_name in file_names:
with open(file_name) as f:
file_data = json.load(f) # load data from JSON to dict
for k, v in file_data.items(): # iterate over key-value pairs
collection.insert_one(v) # your collection object here