Skip to content

Commit 4f5531f

Browse files
committed
Fix indent and incorrect PyMongo collection access syntax
1 parent 7033078 commit 4f5531f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/40-CRUD/4-INSERT-DELETE.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ DELETE FROM reviews WHERE bookId = '0786222727';
154154
<TabItem value="python" label="Python">
155155
<div>
156156
```python
157-
reviews = db.collection("reviews")
158-
reviews.insert_many([
157+
reviews = db["reviews"]
158+
reviews.insert_many([
159159
{
160160
"text": "Thrilling end.",
161161
"rating": 4,
@@ -221,8 +221,8 @@ DELETE FROM reviews WHERE bookId = '0786222727';
221221
<TabItem value="python" label="Python">
222222
<div>
223223
```python
224-
reviews = db.collection("reviews")
225-
reviews.delete_many({"bookId": "0786222727"})
224+
reviews = db["reviews"]
225+
reviews.delete_many({"bookId": "0786222727"})
226226
```
227227
</div>
228228
</TabItem>

docs/40-CRUD/5-UPDATE.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ Executing the above command will insert a fresh new document in the collection,
122122
<TabItem value="python" label="Python">
123123
<div>
124124
```python
125-
reviews = db.collection("books")
126-
reviews.update_one(
125+
books = db["books"]
126+
books.update_one(
127127
{"title": "Treasure of the Sun"},
128128
{"$set": {"pages": 449}}
129129
)

0 commit comments

Comments
 (0)