LoslegenKostenlos loslegen

Connecting to a MongoDB server

To get started you need to connect to a MongoDB server from inside Python. The pymongo package provides the MongoClient for this.

Diese Übung ist Teil des Kurses

Introduction to MongoDB in Python

Kurs anzeigen

Anleitung zur Übung

  • From the pymongo package, import MongoClient so you can use it.
  • Create a MongoClient instance and store it in a variable client.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Import MongoClient
from ____ import ____ 

# Create client
client = ____
Code bearbeiten und ausführen