'Update a document(s) in this collection.
**DEPRECATED** - Use :meth:`replace_one`, :meth:`update_one`, or
:meth:`update_many` instead.
.. versionchanged:: 3.0
Removed the `safe` parameter. Pass ``w=0`` for unacknowledged write
operations.'

def update(self, spec, document, upsert=False, manipulate=False, multi=False, check_keys=True, **kwargs):

    warnings.warn('update    is    deprecated.    Use    replace_one,    update_one    or    update_many    instead.', DeprecationWarning, stacklevel=2)
    common.validate_is_mapping('spec', spec)
    common.validate_is_mapping('document', document)
    if document:
        first = next(iter(document))
        if first.startswith('$'):
            check_keys = False
    write_concern = None
    collation = validate_collation_or_none(kwargs.pop('collation', None))
    if kwargs:
        write_concern = WriteConcern(**kwargs)
    with self._socket_for_writes() as sock_info:
        return self._update(sock_info, spec, document, upsert, check_keys, multi, manipulate, write_concern, collation=collation)
