Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 725 Bytes

mongodb.md

File metadata and controls

44 lines (33 loc) · 725 Bytes
description
Fetch data from a mongodb and get a dataframe

MongoDB

{% embed url="https://www.mongodb.com/" %} Website {% endembed %}

Connect

{% hint style="danger" %} You must Connect before any other methods {% endhint %}

 user = "my user"
 passwd = "my passwd"
 host = "url"
 port = 9090
 ftp = naas_drivers.mongo.connect(host, port, user, passwd)

Get data

collection_name = "col"
db_name = "db_name"
naas_drivers.mongo.get(collection_name, db_name)

Send data

collection_name = "col"
db_name = "db_name"
data = # a dataframe
naas_drivers.mongo.send(data, collection_name, db_name)

Official documentation

{% embed url="https://docs.mongodb.com/" %}