Open mannerism opened 1 year ago
Hi @mannerism!
Thanks!
To connect to MongoDB Atlas you can use something like that:
import pymongo
import pdmongo as pdm
import pandas as pd
from urllib.parse import quote_plus
from pymongo import MongoClient
url = f"mongodb+srv://<username>:{quote_plus('<password>')}@{'<cluster>?retryWrites=true&w=majority'}"
client = MongoClient(url)
df = pd.DataFrame({"A": [1,2]})
df.to_mongo("TestCollection", client['db'])
ddf = pdm.read_mongo("TestCollection", [], client['db'])
Where
You can retrieve those details by clicking "Connect" in MongoDB atlas web UI.
Note
Make sure you have updated to the latest version of this library as I have fixed some issues.
Hello,
First of all, great work you've done to provide this tool. Is there a way for me to connect pandas with mongodb atlas URI?