enter image description hereI have a mongodb connection(posted in image),which is having a collection of say some 20 files. i would like to read/load each collection from python and do the necessary computing.
Please find the sample below what i am trying to do.
import pandas as pd
import json
from pandas.io.json import json_normalize
from unittest.mock import inplace
from pymongo import MongoClient
connection = MongoClient('localhost', 27017)
db=connection.Tmobile
collection=db.collection_names(include_system_collections=False)
for collect1 in collection:
print(collect1)
with open(collect1,'r') as fi:
d=json.load(fi)
print(d)
when i try this it gives me below error.
Mynew Traceback (most recent call last): File "C:\Users\esrilka\eclipse-workspace\My First PyDev Project\dbsample.py", line 12, in with open(collect1,'r') as fi: FileNotFoundError: [Errno 2] No such file or directory: 'Mynew'