The positional mydb argument selects the database; db.users.find() returns all matching documents, and .limit(5) caps the result. Queries return a cursor, so you can chain .sort() and .count(). Related: findOne for a single match.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.