MCPcopy Create free account
hub / github.com/FoundationDB/fdb-document-layer / evaluate

Method evaluate

test/correctness/mongo_model.py:839–851  ·  view source on GitHub ↗
(self, query, document)

Source from the content-addressed store, hash-verified

837 raise MongoModelException("Cannot apply $pullAll to a non-array field.", code=10142)
838
839 def evaluate(self, query, document):
840 acc = True
841 if len(query) == 0:
842 return len(document) == 0
843 for field in query.keys():
844 if field == '_id':
845 tmp = OrderedDict()
846 for k,v in sorted(query[field].items(), key= lambda i: i[0]):
847 tmp[k] = v
848 acc = acc and evaluate(field, tmp, document, self.options, True)
849 else:
850 acc = acc and evaluate(field, query[field], document, self.options, True)
851 return acc
852
853 def process_update_operator_pull(self, key, update_expression):
854 # print "Update Operator: $pull ", update

Callers 1

Calls 1

evaluateFunction · 0.85

Tested by

no test coverage detected