fixed Issue 1572:mongodb contains operator typo, thanks Alan
This commit is contained in:
@@ -1 +1 @@
|
||||
Version 2.6.0-development+timestamp.2013.07.03.01.52.44
|
||||
Version 2.6.0-development+timestamp.2013.07.03.03.59.49
|
||||
|
||||
+2
-2
@@ -5718,7 +5718,7 @@ class MongoDBAdapter(NoSQLAdapter):
|
||||
# There is a technical difference, but mongodb doesn't support
|
||||
# that, but the result will be the same
|
||||
val = second if isinstance(second,self.ObjectId) else \
|
||||
{' $regex':".*" + re.escape(self.expand(second, 'string')) + ".*"}
|
||||
{'$regex':".*" + re.escape(self.expand(second, 'string')) + ".*"}
|
||||
return {self.expand(first) : val}
|
||||
|
||||
def LIKE(self, first, second):
|
||||
@@ -5751,7 +5751,7 @@ class MongoDBAdapter(NoSQLAdapter):
|
||||
#There is a technical difference, but mongodb doesn't support
|
||||
# that, but the result will be the same
|
||||
#TODO contains operators need to be transformed to Regex
|
||||
return {self.expand(first) : {' $regex': \
|
||||
return {self.expand(first) : {'$regex': \
|
||||
".*" + re.escape(self.expand(second, 'string')) + ".*"}}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user