Get startedGet started for free

Setting a new limit?

How many documents does the following expression return?

list(db.prizes.find({"category": "economics"},
                    {"year": 1, "_id": 0})
     .sort("year")
     .limit(3)
     .limit(5))

This exercise is part of the course

Introduction to MongoDB in Python

View Course

Hands-on interactive exercise

Turn theory into action with one of our interactive exercises

Start Exercise