fixed Issue 1572:mongodb contains operator typo, thanks Alan

This commit is contained in:
mdipierro
2013-07-03 04:00:32 -05:00
parent 9a85a132ae
commit 42c36bd295
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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
View File
@@ -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')) + ".*"}}