summaryrefslogtreecommitdiff
path: root/src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp')
-rw-r--r--src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp b/src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp
index 79d8483ab6f..db4e0295c61 100644
--- a/src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp
+++ b/src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp
@@ -112,6 +112,13 @@ CreateIndexesCommand makeTimeseriesCreateIndexesCommand(OperationContext* opCtx,
"TTL indexes are not supported on time-series collections");
}
+
+ if (elem.fieldNameStringData() == IndexDescriptor::kUniqueFieldName) {
+ uassert(ErrorCodes::InvalidOptions,
+ "Unique indexes are not supported on time-series collections",
+ !elem.trueValue());
+ }
+
if (elem.fieldNameStringData() == NewIndexSpec::kKeyFieldName) {
auto pluginName = IndexNames::findPluginName(elem.Obj());
uassert(ErrorCodes::InvalidOptions,