def TYPE(expression):
    """
    Returns a string that specifies the BSON type of the argument.
    See https://docs.mongodb.com/manual/reference/operator/aggregation/type/
    for more details
    :param expression: The expression or variable
    :return: Aggregation operator
    """
    return {'$type': expression}