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.
Cet exercice fait partie du cours
Introduction to MongoDB in Python
Instructions
- From the
pymongopackage, importMongoClientso you can use it. - Create a
MongoClientinstance and store it in a variableclient.
Exercice interactif pratique
Essayez cet exercice en complétant cet exemple de code.
# Import MongoClient
from ____ import ____
# Create client
client = ____