12-21-2022, 05:15 AM
Use python script component.
Paste below script in meta information script section.
import pandas as pd
from pymongo import MongoClient
def myconnect(data):
df = data
client = MongoClient("mongodb://localhost:27017/") #connection_string
mydatabase = client.db_name #dbname
mycollection = mydatabase.collection_name #collection_name
mycollection.insert_many(df.to_dict('records'))
client.close()
Paste below script in meta information script section.
import pandas as pd
from pymongo import MongoClient
def myconnect(data):
df = data
client = MongoClient("mongodb://localhost:27017/") #connection_string
mydatabase = client.db_name #dbname
mycollection = mydatabase.collection_name #collection_name
mycollection.insert_many(df.to_dict('records'))
client.close()