Skip to content

Commit 1555f30

Browse files
authored
Update 2. Working with Distinct Values and Sets.md
1 parent 0811150 commit 1555f30

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Introduction to MongoDB in Python/2. Working with Distinct Values and Sets.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,18 @@ print(ratio)
144144

145145
### # $regex flags beginning,ending,escaping
146146
![image](https://user-images.githubusercontent.com/51888893/204361075-06e60e1d-2979-41c9-82f7-82ac9a38b737.png)
147+
148+
## Glenn, George, and others in the G.B. crew
149+
> How many laureates in total have a first name beginning with "G" and a surname beginning with "S"?
150+
151+
Evaluate the expression
152+
153+
db.laureates.count_documents({"firstname": Regex(____), "surname": Regex(____)})
154+
- [x] in the console, filling in the blanks appropriately.
155+
Possible Answers
156+
- [x] 9 laureates
157+
- [ ] 12 laureates
158+
- [ ] 50 laureates
159+
```py
160+
db.laureates.count_documents({"firstname": Regex("^G"), "surname": Regex("^S")})
161+
```

0 commit comments

Comments
 (0)