๐๏ธ ๐ WHERE โ .find()
Similar to SQL's WHERE clause, the .find() method in MongoDB retrieves documents from a collection that matches a specified query.
๐๏ธ ๐ SELECT โ projection
In SQL, the SELECT statement allows us to specify which columns to retrieve from a table. Similarly, in MongoDB, we use projection in the .find() method to control which fields to include (or exclude) in query results.
๐๏ธ ๐ ORDER BY โ .sort() & LIMIT โ .limit()
In SQL, we use ORDER BY to sort query results and LIMIT to restrict the number of returned rows. MongoDB provides the .sort() and .limit() methods to achieve the same.
๐๏ธ ๐ INSERT โ insertOne() & DELETE โ deleteOne()
MongoDB provides two methods for inserting documents into a collection:
๐๏ธ ๐ UPDATE โ updateOne(), updateMany()
To modify existing documents, MongoDB provides: