minor rewrite of mongoDB adapter

This commit is contained in:
mdipierro
2013-11-16 03:39:39 -06:00
parent e0329ce59a
commit c7cf13f8ea
2 changed files with 5 additions and 13 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.7.4-stable+timestamp.2013.11.16.03.31.47
Version 2.7.4-stable+timestamp.2013.11.16.03.38.41
+4 -12
View File
@@ -5875,23 +5875,15 @@ class MongoDBAdapter(NoSQLAdapter):
# TODO This will probably not work:(
def NOT(self, first):
result = {}
result["$not"] = self.expand(first)
return result
return {'$not': self.expand(first)}
def AND(self,first,second):
f = self.expand(first)
s = self.expand(second)
f.update(s)
return f
# pymongo expects: .find({'$or': [{'name':'1'}, {'name':'2'}]})
return {'$and': [self.expand(first),self.expend(second)]}
def OR(self,first,second):
# pymongo expects: .find({'$or': [{'name':'1'}, {'name':'2'}]})
result = {}
f = self.expand(first)
s = self.expand(second)
result['$or'] = [f,s]
return result
return {'$or': [self.expand(first),self.expend(second)]}
def BELONGS(self, first, second):
if isinstance(second, str):