diff options
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r-- | src/mongo/db/dbhelpers.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 36b034e0b05..29e2ce7f289 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -130,7 +130,7 @@ bool Helpers::findById(OperationContext* opCtx, invariant(database); // TODO ForRead? - Collection* collection = + const Collection* collection = CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, NamespaceString(ns)); if (!collection) { return false; @@ -139,7 +139,7 @@ bool Helpers::findById(OperationContext* opCtx, if (nsFound) *nsFound = true; - IndexCatalog* catalog = collection->getIndexCatalog(); + const IndexCatalog* catalog = collection->getIndexCatalog(); const IndexDescriptor* desc = catalog->findIdIndex(opCtx); if (!desc) @@ -287,7 +287,7 @@ BSONObj Helpers::inferKeyPattern(const BSONObj& o) { void Helpers::emptyCollection(OperationContext* opCtx, const NamespaceString& nss) { OldClientContext context(opCtx, nss.ns()); repl::UnreplicatedWritesBlock uwb(opCtx); - Collection* collection = context.db() + const Collection* collection = context.db() ? CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, nss) : nullptr; deleteObjects(opCtx, collection, nss, BSONObj(), false); |