File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Open diff view settings
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Open diff view settings
Original file line number Diff line number Diff line change 1919 - [[#specify-conditions-using-query-operators][Specify Conditions Using Query Operators]]
2020 - [[#specify-and-conditions][Specify AND Conditions]]
2121 - [[#specify-or-conditions][Specify OR Conditions]]
22+ - [[#specify-and-as-well-as-or-conditions][Specify AND as well as OR Conditions]]
2223 - [[#print-results][Print results]]
2324 - [[#docker-container][Docker container]]
2425 - [[#dockerfile][Dockerfile]]
@@ -176,6 +177,14 @@ cursor = collection.find({"status": "A", "qty": {"$lt": 30}})
176177cursor = collection.find({"$or": [{"status": "A"}, {"qty": {"$lt": 30}}]})
177178#+END_SRC
178179
180+ *** Specify AND as well as OR Conditions
181+
182+ #+BEGIN_SRC python
183+ cursor = collection.find({
184+ "status": "A",
185+ "$or": [{"qty": {"$lt": 30}}, {"item": {"$regex": "^p"}}]})
186+ #+END_SRC
187+
179188*** Print results
180189
181190#+BEGIN_SRC python
You can’t perform that action at this time.
0 commit comments