@@ -8,7 +8,7 @@ In SQL, the `SELECT` statement allows us to specify which columns to retrieve fr
88db .collection .find ({ < query> }, { projection })
99```
1010
11- ## ** Projection Basics **
11+ ## ** Projection basics **
1212
1313- By default, MongoDB returns all fields in a document.
1414- Use projection to ** include (1)** or ** exclude (0)** specific fields.
@@ -21,7 +21,7 @@ db.collection.find({ <query> }, { projection })
2121db .books .find ({}, { title: 1 , authors: 1 , _id: 0 });
2222```
2323
24- ** Equivalent SQL Query :**
24+ ** Equivalent SQL query :**
2525
2626``` sql
2727SELECT title, authors FROM books;
4040db .books .find ({}, { reviews: 0 });
4141```
4242
43- ** Equivalent SQL Query :**
43+ ** Equivalent SQL query :**
4444
4545``` sql
4646SELECT title, authors, genres, totalInventory, available FROM books;
@@ -52,13 +52,13 @@ Here:
5252
5353---
5454
55- ## ** Example 3: Using Projection along with a Query **
55+ ## ** Example 3: Using projection along with a query **
5656
5757``` js
5858db .books .find ({ genres: " Science" }, { title: 1 , totalInventory: 1 , _id: 0 });
5959```
6060
61- ** Equivalent SQL Query :**
61+ ** Equivalent SQL query :**
6262
6363``` sql
6464SELECT title, totalInventory FROM books WHERE genres= ' Science' ;
0 commit comments