PYTHON-4371 Fix include_system_collections example in migration guide (#1596)

This commit is contained in:
Shane Harvey 2024-04-16 11:30:05 -07:00 committed by GitHub
parent 724186700f
commit 5a0c81c00c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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
..............................