def cleanup_favorite(favorite):
    """Given a dictionary of a favorite record, return a new dictionary for
    output as JSON."""
    
    favorite_data = favorite
    favorite_data["user"] = str(favorite["user"])
    favorite_data["post"] = str(favorite["post"])
    favorite_data["id"] = str(favorite["_id"])
    del favorite_data["_id"]
    
    return favorite_data