summaryrefslogtreecommitdiff
path: root/src/mongo/db/db_raii.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r--src/mongo/db/db_raii.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp
index 581f038afc8..bd906e36f15 100644
--- a/src/mongo/db/db_raii.cpp
+++ b/src/mongo/db/db_raii.cpp
@@ -936,6 +936,18 @@ const NamespaceString& AutoGetCollectionForReadCommandMaybeLockFree::getNss() co
}
}
+query_shape::CollectionType AutoGetCollectionForReadCommandMaybeLockFree::getCollectionType()
+ const {
+ if (auto&& view = getView()) {
+ return view->timeseries() ? query_shape::CollectionType::kTimeseries
+ : query_shape::CollectionType::kView;
+ }
+ auto&& collection = getCollection();
+ return collection ? query_shape::CollectionType::kCollection
+ : query_shape::CollectionType::kNonExistent;
+}
+
+
bool AutoGetCollectionForReadCommandMaybeLockFree::isAnySecondaryNamespaceAViewOrSharded() const {
return _autoGet ? _autoGet->isAnySecondaryNamespaceAViewOrSharded()
: _autoGetLockFree->isAnySecondaryNamespaceAViewOrSharded();