diff options
Diffstat (limited to 'src/mongo/db/commands/list_collections.cpp')
-rw-r--r-- | src/mongo/db/commands/list_collections.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/commands/list_collections.cpp b/src/mongo/db/commands/list_collections.cpp index 571c3156786..4d192815e27 100644 --- a/src/mongo/db/commands/list_collections.cpp +++ b/src/mongo/db/commands/list_collections.cpp @@ -440,8 +440,10 @@ public: // needing to yield as we don't take any locks. if (opCtx->isLockFreeReadsOp()) { auto collectionCatalog = CollectionCatalog::get(opCtx); - for (auto&& coll : collectionCatalog->range(dbName)) { - perCollectionWork(coll); + for (auto it = collectionCatalog->begin(opCtx, dbName); + it != collectionCatalog->end(opCtx); + ++it) { + perCollectionWork(*it); } } else { mongo::catalog::forEachCollectionFromDb( |