Introductie tot MongoDB in Python
Filip Schouwenaars
Machine Learning Researcher
# Setup from pymongo import MongoClient client = MongoClient() mov = client.film.movies# Verwijder document dat op filter matcht, zoals find_one() res = mov.delete_one({ "title": "gladiator" })# Hoeveel documenten verwijderd? res.deleted_count
1
# Verwijder alle echt slechte films res = mov.delete_many({ "rating": { "$lt": 5.0 } })# Hoeveel documenten verwijderd? res.deleted_count
4
Introductie tot MongoDB in Python