ComeçarComece de graça

Composing filters

It is often useful to incrementally build up a filter document in order to see the effect of adding constraints one at a time. In this exercise, we will count the number of laureate documents matching some criteria, and we will gradually add criteria.

Este exercício faz parte do curso

Introduction to MongoDB in Python

Ver curso

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# Create a filter for laureates who died in the USA
criteria = {____: ____}

# Save the count of these laureates
count = db.laureates.count_documents(____)
print(count)
Editar e executar o código