Mongo

What is the difference between find() and find_one()?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

  • find() returns all documents that match the query conditions.
    • find_one() returns only one document that matches the query conditions (or null if no match is found).