def regex_query(field_name, value):
    """Create a regex query.

    Constructs a MongoDB regex query that will match documents in which
    the specified value is found somewhere within the content of the
    given field.

    Parameters
    ----------
    field_name : str
        The name of the field to be queried.

    value : str
        A value that should appear somewhere in the field's content.

    Returns
    -------
    dict
        A MongoDB regexp query.

    """
    return {field_name: {'$regex': value, '$options': 'i'}}