summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2022-02-04 13:31:45 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-04 14:21:08 +0000
commit76f0c856f0e6b3bb50908f007a9b849c9a716ac3 (patch)
treefd830dc0bd51853e82f4c7d75077ea4e982db370
parent2e878f0d1f4234199fe0602878de0ac1ce7aa0cc (diff)
downloadmongo-76f0c856f0e6b3bb50908f007a9b849c9a716ac3.tar.gz
SERVER-63291 Swap numeric error code with IndexOptionsConflict
-rw-r--r--jstests/core/timeseries/timeseries_index_partial.js4
-rw-r--r--src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/jstests/core/timeseries/timeseries_index_partial.js b/jstests/core/timeseries/timeseries_index_partial.js
index 3a637282253..eb1780feb12 100644
--- a/jstests/core/timeseries/timeseries_index_partial.js
+++ b/jstests/core/timeseries/timeseries_index_partial.js
@@ -253,7 +253,7 @@ assert.docEq(buckets.getIndexes(), extraBucketIndexes.concat([
collation: {locale: "simple"},
partialFilterExpression: {a: {$lt: "25"}}
}),
- [5916300]);
+ [ErrorCodes.IndexOptionsConflict]);
assert.commandFailedWithCode(
coll.createIndex({a: 1}, {
name: "a_lt_25_numeric",
@@ -261,7 +261,7 @@ assert.docEq(buckets.getIndexes(), extraBucketIndexes.concat([
partialFilterExpression: {a: {$lt: "25"}}
}),
// The default collation is also numeric, so this index is equivalent to the previous.
- [5916300]);
+ [ErrorCodes.IndexOptionsConflict]);
assert.commandWorked(coll.createIndex(
{a: 1}, {name: "a_lt_25_default", partialFilterExpression: {a: {$lt: "25"}}}));
diff --git a/src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp b/src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp
index dc6714f9ab1..961344afd0e 100644
--- a/src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp
+++ b/src/mongo/db/timeseries/timeseries_commands_conversion_helper.cpp
@@ -103,7 +103,7 @@ CreateIndexesCommand makeTimeseriesCreateIndexesCommand(OperationContext* opCtx,
// ($gt, $lt, etc).
if (auto collatorSpec = origIndex[NewIndexSpec::kCollationFieldName]) {
uasserted(
- 5916300,
+ ErrorCodes::IndexOptionsConflict,
std::string{"On a time-series collection, partialFilterExpression and "} +
NewIndexSpec::kCollationFieldName + " arguments are incompatible"_sd);
}