Links

Get data

Tags: #mongodb #database #naas_drivers #snippet #operations #naas
Author: Florent Ravenel​
Description: This notebook provides instructions on how to retrieve data from a MongoDB database.

Input

Import library

from naas_drivers import mongo

Setup your MongoDB

# Credentials
user = "my user"
passwd = "my passwd"
host = "url"
port = 9090
​
# DB parameters
collection_name = "col"
db_name = "db_name"

Model

Get data

df = naas_drivers.mongo.connect(host, port, user, passwd).get(collection_name, db_name)

Output

Display result

df
Last modified 1mo ago