File tree Expand file tree Collapse file tree 3 files changed +7
-8
lines changed
Expand file tree Collapse file tree 3 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ TaskRecord keys:
8080MongoDB operators we emulate on all backends:
8181
8282| Operator | Python equivalent |
83- | -------- | ------------------------------------------------------------------------------- |
83+ | -------- | ----------------------------------------------------------------------------- |
8484| '\$ in' | in |
8585| '\$ nin' | not in |
8686| '\$ eq' | == |
@@ -89,12 +89,12 @@ MongoDB operators we emulate on all backends:
8989| '\$ gte' | >= |
9090| '\$ le' | \< |
9191| '\$ lte' | \< = |
92- | '\$ glob' | [ fnmatch] ( https://docs.python.org/3/library/fnmatch.html ) (wildcard matching) |
92+ | '\$ glob' | [ fnmatch] ( https://docs.python.org/3/library/fnmatch.html ) (wildcard matching) |
9393
94- Remarks on _ $glob_ : The operator can be used to find substrings in DB columns based on
95- [ unix style filename pattern matching] ( https://docs.python.org/3/library/fnmatch.html )
96- _ $glob_ is ** not** a regular MongoDB opertor, but is internally translated to a regular
97- expression (_ $regex_ ) which is natively supported by MongoDB.
94+ Remarks on _ $glob_ : The operator can be used to find substrings in DB columns based on
95+ [ unix style filename pattern matching] ( https://docs.python.org/3/library/fnmatch.html )
96+ _ $glob_ is ** not** a regular MongoDB opertor, but is internally translated to a regular
97+ expression (_ $regex_ ) which is natively supported by MongoDB.
9898
9999The DB Query is useful for two primary cases:
100100
Original file line number Diff line number Diff line change 3737# Distributed under the terms of the Modified BSD License.
3838import copy
3939import fnmatch
40- import re
4140from copy import deepcopy
4241from datetime import datetime
4342
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ def _translate(self, filter):
127127 )
128128 # we need to attach the start and end match character to achieve
129129 # an equivalent matching behavior to fnmatch in mongoDB
130- ret ["$regex" ] = "^" + fnmatch .translate (glob )+ "$"
130+ ret ["$regex" ] = "^" + fnmatch .translate (glob ) + "$"
131131 else :
132132 for key , value in filter .items ():
133133 if isinstance (value , dict ):
You can’t perform that action at this time.
0 commit comments