def LAST(expression):
    """
    Returns the value that results from applying an expression to the last document in a group of documents that share the same group by key.
    Only meaningful when documents are in a defined order.
    See https://docs.mongodb.com/manual/reference/operator/aggregation/last/
    for more details
    :param expression: expression or variables
    :return: Aggregation operator
    """
    return {'$last': expression}
