From 5a0c81c00c47fd67991b13141d4e569db6c0fa44 Mon Sep 17 00:00:00 2001 From: Shane Harvey Date: Tue, 16 Apr 2024 11:30:05 -0700 Subject: [PATCH] PYTHON-4371 Fix include_system_collections example in migration guide (#1596) --- doc/migrate-to-pymongo4.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/migrate-to-pymongo4.rst b/doc/migrate-to-pymongo4.rst index 35fc922d5..f751b4181 100644 --- a/doc/migrate-to-pymongo4.rst +++ b/doc/migrate-to-pymongo4.rst @@ -328,13 +328,13 @@ Removed :meth:`pymongo.database.Database.collection_names`. Use :meth:`~pymongo.database.Database.list_collection_names` instead. Code like this:: - names = client.collection_names() - non_system_names = client.collection_names(include_system_collections=False) + names = client.db.collection_names() + non_system_names = client.db.collection_names(include_system_collections=False) can be changed to this:: - names = client.list_collection_names() - non_system_names = client.list_collection_names(filter={"name": {"$regex": r"^(?!system\\.)"}}) + names = client.db.list_collection_names() + non_system_names = client.db.list_collection_names(filter={"name": {"$regex": "^(?!system\\.)"}}) Database.current_op is removed ..............................