Our 'born' approximation, and a special laureate
We saw earlier that the laureates collection encodes uncertainty about birthdate in a special way. When a birthdate is unknown, the "born"
field has the value "0000-00-00"
. Thus,
db.laureates.count_documents({"born": "0000-00-00"})
counts the number of such laureates. Or does it?
We also saw that the total number of laureate prizes is more than the number of laureates -- some were awarded more than one prize. There is one in particular with a whopping three prizes, and this laureate holds key information to aid our quest to determine the proportion of prizes awarded to immigrants.
This exercise is part of the course
Introduction to MongoDB in Python
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Filter for documents without a "born" field
criteria = {____: {____: ____}}
# Save count
count = db.laureates.count_documents(criteria)
print(count)