def parser_to_dict(parser):
    """ Given a parser, generate mongo args """
    args = {}
    if parser.id:
        args['id'] = parser.id
    if parser.name:
        args['name'] = parser.name
    if parser.status:
        args['status'] = parser.status
    if parser.owner:
        args['owner'] = parser.owner
    if parser.recruiter:
        args['recruiter'] = parser.recruiter
    if parser.code_review:
        args['code_review'] = parser.code_review
    return args
