Source code for cookbase.db.utils
from functools import wraps
from typing import Callable
[docs]def demongofy(f: Callable):
"""Decorator function that processes a JSON document retrieved from MongoDB.
:param f: The decorated function
:type f: Callable
"""
@wraps(f)
def wrapper(*args, **kwargs):
return deunderscore_id(f(*args, **kwargs))
return wrapper