Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3674154

Browse filesBrowse files
committed
Add Specify AND as well as OR Conditions.
1 parent 6c4627d commit 3674154
Copy full SHA for 3674154

File tree

Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-0
lines changed
Open diff view settings
Collapse file

‎README.org‎

Copy file name to clipboardExpand all lines: README.org
+9Lines changed: 9 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
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}})
176177
cursor = 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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.