Python MongoDB
MongoDB Limit
Limiting results
MongoDB Limit
To limit the result in MongoDB, we use the limit() method.
Limit Results
myresult = mycol.find().limit(5)
for x in myresult:
print(x)
Python MongoDB — Knowledge Check
Check your understanding of this section. Results are not saved—refresh the page to start over.