Hi I am trying to read data from MongoDB and trying to convert it into data frame but getting an error that says "("Could not convert ObjectId('620d3f43ae93743dbb6f6846') with type ObjectId: did not recognize Python value type when inferring an Arrow data type", 'Conversion failed for column _id with type object')".
my code looks like this:
import streamlit as st
import pymongo
import streamlit as st
from pymongo import MongoClient
import pandas as pd
import json
import string
import io
import re
import time
import csv
from pandas import Timestamp
import certifi
import datetime
from pandas.io.json import json_normalize
client=pymongo.MongoClient()
connection = MongoClient("mongodb+srv://*****:****@cluster0.t4iwt.mongodb.net/testdb?retryWrites=true&w=majority",tlsCAFile=certifi.where())
db=connection["testdb"]
collection=db["test"]
cursor = collection.find()
entries=list(cursor)
entries[:]
df=pd.DataFrame(entries)
st.write(df)