summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/shard_key_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s/shard_key_util.h')
-rw-r--r--src/mongo/db/s/shard_key_util.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/mongo/db/s/shard_key_util.h b/src/mongo/db/s/shard_key_util.h
index 619ced60915..6d7a41db58e 100644
--- a/src/mongo/db/s/shard_key_util.h
+++ b/src/mongo/db/s/shard_key_util.h
@@ -149,6 +149,19 @@ void validateShardKeyIndexExistsOrCreateIfPossible(OperationContext* opCtx,
const boost::optional<BSONObj>& defaultCollation,
bool unique,
const ShardKeyValidationBehaviors& behaviors);
-
+/**
+ * Compares the proposed shard key with the collection's existing indexes to ensure they are a legal
+ * combination.
+ *
+ * Returns true if the shard key is valid and already exists. Steps 1, 2 and 3 of the previous
+ * function.
+ *
+ */
+bool validShardKeyIndexExists(OperationContext* opCtx,
+ const NamespaceString& nss,
+ const ShardKeyPattern& shardKeyPattern,
+ const boost::optional<BSONObj>& defaultCollation,
+ bool unique,
+ const ShardKeyValidationBehaviors& behaviors);
} // namespace shardkeyutil
} // namespace mongo