'Reloads all attributes from the database.
:param fields: (optional) args list of fields to reload
:param max_depth: (optional) depth of dereferencing to follow
.. versionadded:: 0.1.2
.. versionchanged:: 0.6  Now chainable
.. versionchanged:: 0.9  Can provide specific fields to reload'

def reload(self, *fields, **kwargs):

    max_depth = 1
    if (fields and isinstance(fields[0], int)):
        max_depth = fields[0]
        fields = fields[1:]
    elif ('max_depth' in kwargs):
        max_depth = kwargs['max_depth']
    if (self.pk is None):
        raise self.DoesNotExist('Document    does    not    exist')
    obj = self._qs.read_preference(ReadPreference.PRIMARY).filter(**self._object_key).only(*fields).limit(1).select_related(max_depth=max_depth)
    if obj:
        obj = obj[0]
    else:
        raise self.DoesNotExist('Document    does    not    exist')
    for field in obj._data:
        if ((not fields) or (field in fields)):
            try:
                setattr(self, field, self._reload(field, obj[field]))
            except (KeyError, AttributeError):
                try:
                    setattr(self, field, self._reload(field, obj._data.get(field)))
                except KeyError:
                    delattr(self, field)
    self._changed_fields = obj._changed_fields
    self._created = False
    return self
