summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/collection.h
diff options
context:
space:
mode:
authorKaloian Manassiev <kaloian.manassiev@mongodb.com>2023-01-24 17:46:05 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-24 19:57:13 +0000
commitd1e6694bc652cca179f2f68c39b751a78fcbd55c (patch)
tree289015565b9da9f1ffb3d7dba5cac6dac820521e /src/mongo/db/catalog/collection.h
parentb6152817bb33a1f128c54a8a95343dc8f57af64e (diff)
downloadmongo-d1e6694bc652cca179f2f68c39b751a78fcbd55c.tar.gz
SERVER-73238 Cleanup direct linking references to `sharding_api_d`
Diffstat (limited to 'src/mongo/db/catalog/collection.h')
-rw-r--r--src/mongo/db/catalog/collection.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mongo/db/catalog/collection.h b/src/mongo/db/catalog/collection.h
index 7e5fff04e1b..48e2294ca76 100644
--- a/src/mongo/db/catalog/collection.h
+++ b/src/mongo/db/catalog/collection.h
@@ -30,7 +30,6 @@
#pragma once
#include <functional>
-#include <memory>
#include <string>
#include <vector>
@@ -54,6 +53,7 @@
#include "mongo/db/yieldable.h"
#include "mongo/logv2/log_attr.h"
#include "mongo/platform/mutex.h"
+#include "mongo/s/shard_key_pattern.h"
#include "mongo/util/decorable.h"
namespace mongo {
@@ -768,10 +768,8 @@ public:
friend std::ostream& operator<<(std::ostream& os, const CollectionPtr& coll);
- void setShardKeyPattern(const BSONObj& shardKeyPattern) {
- _shardKeyPattern = shardKeyPattern.getOwned();
- }
- const BSONObj& getShardKeyPattern() const;
+ void setShardKeyPattern(const BSONObj& shardKeyPattern);
+ const ShardKeyPattern& getShardKeyPattern() const;
bool isSharded() const {
return static_cast<bool>(_shardKeyPattern);
@@ -793,7 +791,7 @@ private:
// Stores a consistent view of shard key with the collection that will be needed during the
// operation. If _shardKeyPattern is set, that indicates that the collection is sharded.
- boost::optional<BSONObj> _shardKeyPattern = boost::none;
+ boost::optional<ShardKeyPattern> _shardKeyPattern = boost::none;
};
inline std::ostream& operator<<(std::ostream& os, const CollectionPtr& coll) {