pymongo breaking changes
Every breaking API change we have recorded in pymongo on PyPI: 427 breaking changes in 7 versions. Below are its newest 6 versions, removals and renames first, each with its source.
Newest change September 3, 2026

On this page
4.18.0
- Removed
pymongo.asynchronous.aggregation.Server.checkout
Server.checkout was removed in pymongo 4.18.0 pypi.org - Removed
pymongo.asynchronous.aggregation.Server.operation_to_command
Server.operation_to_command was removed in pymongo 4.18.0 pypi.org - Removed
pymongo.asynchronous.aggregation.Server.run_operation
Server.run_operation was removed in pymongo 4.18.0 pypi.org - Removed
pymongo.asynchronous.bulk.NotPrimaryError
pymongo.asynchronous.bulk.NotPrimaryError was removed in pymongo 4.18.0 pypi.org - Removed
pymongo.asynchronous.change_stream.AsyncConnection
pymongo.asynchronous.change_stream.AsyncConnection was removed in pymongo 4.18.0 pypi.org - Removed
pymongo.asynchronous.client_session.Binary
pymongo.asynchronous.client_session.Binary was removed in pymongo 4.18.0 pypi.org - Removed
pymongo.asynchronous.client_session.ExecutionTimeout
pymongo.asynchronous.client_session.ExecutionTimeout was removed in pymongo 4.18.0 pypi.org - Removed
pymongo.asynchronous.client_session.NetworkTimeout
pymongo.asynchronous.client_session.NetworkTimeout was removed in pymongo 4.18.0 pypi.org - Removed
pymongo.asynchronous.encryption.BSONError
pymongo.asynchronous.encryption.BSONError was removed in pymongo 4.18.0 pypi.org - Removed
pymongo.asynchronous.encryption.BulkWriteResult
pymongo.asynchronous.encryption.BulkWriteResult was removed in pymongo 4.18.0 pypi.org
And 168 more in this version.
4.17.0
- Removed
pymongo.common.validate_auth_option
pymongo.common.validate_auth_option was removed in pymongo 4.17.0 pypi.org - Removed
pymongo.common.validate_int_or_basestring
pymongo.common.validate_int_or_basestring was removed in pymongo 4.17.0 pypi.org - Removed
pymongo.common.validate_positive_integer_or_none
pymongo.common.validate_positive_integer_or_none was removed in pymongo 4.17.0 pypi.org - Renamed
pymongo.asynchronous.cursor.AsyncConnection
Use pymongo.asynchronous.cursor_base.AsyncConnection instead. pypi.org - Renamed
pymongo.synchronous.cursor.Connection
Use pymongo.synchronous.cursor_base.Connection instead. pypi.org - Behavior changed
Index information returned by the driver now includes simple collation. Code that compares or parses index information may see an extra field. github.com - Behavior changed
On replica sets, server selection now deprioritizes a server only after overload errors, not for other errors. Code that relied on the previous deprioritization may see different server choices. github.com - Signature changed
pymongo.asynchronous.aggregation.AsyncCommandCursor
Was class AsyncCommandCursor(Generic[_DocumentType]); now class AsyncCommandCursor(_AsyncCursorBase[_DocumentType]). pypi.org - Signature changed
pymongo.asynchronous.aggregation.AsyncCommandCursor.cursor_id
Was cursor_id: int; now cursor_id: Optional[int]. pypi.org - Signature changed
pymongo.asynchronous.change_stream.AsyncCommandCursor
Was class AsyncCommandCursor(Generic[_DocumentType]); now class AsyncCommandCursor(_AsyncCursorBase[_DocumentType]). pypi.org
And 30 more in this version.
4.16.0
- Signature changed
bson.Binary.as_vector
Was def as_vector(self) -> BinaryVector; now def as_vector(self, return_numpy: bool = False) -> BinaryVector. pypi.org - Signature changed
bson.binary.BinaryVector.__init__
Was def __init__(self, data: Sequence[float | int], dtype: BinaryVectorDtype, padding: int = 0); now def __init__(self, data: Union[Sequence[float | int], npt.NDArray[np.number]], dtype: BinaryVectorDtype, padding: int = 0). pypi.org - Signature changed
bson.Binary.from_vector
Was @classmethod def from_vector(cls: Type[Binary], vector: Union[BinaryVector, list[int], list[float]], dtype: Optional[BinaryVectorDtype] = None, padding: Optional[int] = None) -> Binary; now @classmethod def from_vector(cls... pypi.org - Signature changed
pymongo.asynchronous.aggregation.AsyncCollection.find_one_and_delete
Was async def find_one_and_delete(self, filter: Mapping[str, Any], projection: Optional[Union[Mapping[str, Any], Iterable[str]]] = None, sort: Optional[_IndexList] = None, hint: Optional[_IndexKeyHint] = None, session... pypi.org - Signature changed
pymongo.asynchronous.aggregation.AsyncCollection.find_one_and_replace
Was async def find_one_and_replace(self, filter: Mapping[str, Any], replacement: Mapping[str, Any], projection: Optional[Union[Mapping[str, Any], Iterable[str]]] = None, sort: Optional[_IndexList] = None, upsert: bool = False... pypi.org - Signature changed
pymongo.asynchronous.aggregation.AsyncCollection.find_one_and_update
Was async def find_one_and_update(self, filter: Mapping[str, Any], update: Union[Mapping[str, Any], _Pipeline], projection: Optional[Union[Mapping[str, Any], Iterable[str]]] = None, sort: Optional[_IndexList] = None, upsert: bool = False... pypi.org - Signature changed
pymongo.asynchronous.aggregation.AsyncCommandCursor.__init__
Was def __init__(self, collection: AsyncCollection[_DocumentType], cursor_info: Mapping[str, Any], address: Optional[_Address], batch_size: int = 0, max_await_time_ms: Optional[int] = None, session: Optional[AsyncClientSession] = None... pypi.org - Signature changed
pymongo.asynchronous.collection.AsyncRawBatchCommandCursor.__init__
Was def __init__(self, collection: AsyncCollection[_DocumentType], cursor_info: Mapping[str, Any], address: Optional[_Address], batch_size: int = 0, max_await_time_ms: Optional[int] = None, session: Optional[AsyncClientSession] = None... pypi.org - Signature changed
pymongo.asynchronous.mongo_client.Topology.select_servers
Was async def select_servers(self, selector: Callable[[Selection], Selection], operation: str, server_selection_timeout: Optional[float] = None, address: Optional[_Address] = None, operation_id: Optional[int] = None) -> list[Server]; now... pypi.org - Signature changed
pymongo.collection.Collection.find_one_and_delete
Was def find_one_and_delete(self, filter: Mapping[str, Any], projection: Optional[Union[Mapping[str, Any], Iterable[str]]] = None, sort: Optional[_IndexList] = None, hint: Optional[_IndexKeyHint] = None, session: Optional[ClientSession] =... pypi.org
And 6 more in this version.
4.15.4
- Signature changed
pymongo.asynchronous.aggregation.AsyncClientSession.with_transaction
Was async def with_transaction(self, callback: Callable[[AsyncClientSession], Coroutine[Any, Any, _T]], read_concern: Optional[ReadConcern] = None, write_concern: Optional[WriteConcern] = None, read_preference: Optional[_ServerMode] =... pypi.org
4.15.3
- Signature changed
pymongo.asynchronous.aggregation.AsyncCollection.distinct
Was async def distinct(self, key: str, filter: Optional[Mapping[str, Any]] = None, session: Optional[AsyncClientSession] = None, comment: Optional[Any] = None, hint: Optional[_IndexKeyHint] = None, **kwargs: Any) -> list[str]; now async... pypi.org - Signature changed
pymongo.asynchronous.collection.AsyncCursor.distinct
Was async def distinct(self, key: str) -> list[str]; now async def distinct(self, key: str) -> list[Any]. pypi.org - Signature changed
pymongo.collection.Collection.distinct
Was def distinct(self, key: str, filter: Optional[Mapping[str, Any]] = None, session: Optional[ClientSession] = None, comment: Optional[Any] = None, hint: Optional[_IndexKeyHint] = None, **kwargs: Any) -> list[str]; now def distinct(self... pypi.org - Signature changed
pymongo.cursor.Cursor.distinct
Was def distinct(self, key: str) -> list[str]; now def distinct(self, key: str) -> list[Any]. pypi.org
4.15.1
- Removed
pymongo.asynchronous.encryption.async_receive_kms
pymongo.asynchronous.encryption.async_receive_kms was removed in pymongo 4.15.1 pypi.org - Removed
pymongo.asynchronous.encryption.async_sendall
pymongo.asynchronous.encryption.async_sendall was removed in pymongo 4.15.1 pypi.org - Removed
pymongo.asynchronous.encryption.AsyncBaseConnection
pymongo.asynchronous.encryption.AsyncBaseConnection was removed in pymongo 4.15.1 pypi.org - Removed
pymongo.asynchronous.encryption.PyMongoKMSProtocol
pymongo.asynchronous.encryption.PyMongoKMSProtocol was removed in pymongo 4.15.1 pypi.org - Removed
pymongo.asynchronous.pool.AsyncBaseConnection
pymongo.asynchronous.pool.AsyncBaseConnection was removed in pymongo 4.15.1 pypi.org - Removed
pymongo.network_layer.async_receive_kms
pymongo.network_layer.async_receive_kms was removed in pymongo 4.15.1 pypi.org - Removed
pymongo.network_layer.AsyncBaseConnection
pymongo.network_layer.AsyncBaseConnection was removed in pymongo 4.15.1 pypi.org - Removed
pymongo.network_layer.BaseConnection
pymongo.network_layer.BaseConnection was removed in pymongo 4.15.1 pypi.org - Removed
pymongo.network_layer.PyMongoBaseProtocol
pymongo.network_layer.PyMongoBaseProtocol was removed in pymongo 4.15.1 pypi.org - Removed
pymongo.network_layer.PyMongoKMSProtocol
pymongo.network_layer.PyMongoKMSProtocol was removed in pymongo 4.15.1 pypi.org
And 64 more in this version.
Check your code
These are the changes. To see which of them reach your code, scan a public repository, or have your coding agent call check_code with your manifest or lockfile over MCP. The API reads every change in every version, not only the newest. On Team and up, a fix pull request opens for the changes that reach a connected repository. Nothing merges or deploys.

Put your code on continuous management.
Scan a public repository now, or give your agent one line.
See how out of date your code is.
Tell your agent what changed since it was trained.
claude mcp add --transport http since https://api.since.dev/mcp