Mulai sekarangMulai gratis

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.

Latihan ini merupakan bagian dari kursus

Introduction to MongoDB in Python

Lihat Kursus

Instruksi latihan

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

Latihan interaktif langsung praktik

Cobalah latihan ini dengan melengkapi kode contoh ini.

# Import MongoClient
from ____ import ____ 

# Create client
client = ____
Edit dan Jalankan Kode