def first(resolve=True):
    """ Return the first element in the sequence.  If ``resolve`` is True,
        and the result set has a valid resolver, return the resolved
        document, otherwise return the document id of the first document. """
