Comece agoraComece grátis

Deleting multiple MongoDB documents

It's time for some database cleanup. More specifically, you're going to use .delete_many() to delete all movies that were released a long time ago, in one go.

Este exercicio faz parte do curso

Introduction to MongoDB in Python

Ver curso

Instruções do exercicio

  • Delete all movies that have a "release_year" before 1990.
  • Print the number of deleted documents.

exercicio interativo prático

Tente este exercicio completando este código de exemplo.

from pymongo import MongoClient 
client = MongoClient()
mov = client.film.movies

# Delete all movies released before 1990
res = ____

# Print the number of deleted documents
print(____)
Editar e Executar Código