fixing incompatibility with mongoengine aggregation to support mongo 4.4

This commit is contained in:
Bastien Gerard
2021-02-28 14:07:15 +01:00
parent 2d1c9afbb7
commit 8ef771912d
5 changed files with 31 additions and 10 deletions

View File

@@ -34,6 +34,14 @@ def get_as_pymongo(doc):
return doc.__class__.objects.as_pymongo().get(id=doc.id)
def requires_mongodb_lt_42(func):
return _decorated_with_ver_requirement(func, (4, 2), oper=operator.lt)
def requires_mongodb_lte_42(func):
return _decorated_with_ver_requirement(func, (4, 2), oper=operator.le)
def requires_mongodb_gte_44(func):
return _decorated_with_ver_requirement(func, (4, 4), oper=operator.ge)