Skip to content

Commit 5a0c81c

Browse files
authored
PYTHON-4371 Fix include_system_collections example in migration guide (#1596)
1 parent 7241867 commit 5a0c81c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

doc/migrate-to-pymongo4.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,13 @@ Removed :meth:`pymongo.database.Database.collection_names`. Use
328328
:meth:`~pymongo.database.Database.list_collection_names` instead. Code like
329329
this::
330330

331-
names = client.collection_names()
332-
non_system_names = client.collection_names(include_system_collections=False)
331+
names = client.db.collection_names()
332+
non_system_names = client.db.collection_names(include_system_collections=False)
333333

334334
can be changed to this::
335335

336-
names = client.list_collection_names()
337-
non_system_names = client.list_collection_names(filter={"name": {"$regex": r"^(?!system\\.)"}})
336+
names = client.db.list_collection_names()
337+
non_system_names = client.db.list_collection_names(filter={"name": {"$regex": "^(?!system\\.)"}})
338338

339339
Database.current_op is removed
340340
..............................

0 commit comments

Comments
 (0)