summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/run_aggregate.cpp
diff options
context:
space:
mode:
authorJack Mulrow <jack.mulrow@mongodb.com>2023-03-03 03:51:03 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-03-31 02:16:06 +0000
commitccddcca1fc6bf5f2c9f7012c74dd216a35e8d580 (patch)
tree9d96e40b053726e792646348e6f7d18ed694eae2 /src/mongo/db/commands/run_aggregate.cpp
parent8a0ab094055d03b4bdbe528c5faf5fdfe72c8aee (diff)
downloadmongo-ccddcca1fc6bf5f2c9f7012c74dd216a35e8d580.tar.gz
SERVER-74567 Remove ClusterRole equality operator
Diffstat (limited to 'src/mongo/db/commands/run_aggregate.cpp')
-rw-r--r--src/mongo/db/commands/run_aggregate.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mongo/db/commands/run_aggregate.cpp b/src/mongo/db/commands/run_aggregate.cpp
index cb6d9503b13..6f503f0f850 100644
--- a/src/mongo/db/commands/run_aggregate.cpp
+++ b/src/mongo/db/commands/run_aggregate.cpp
@@ -812,10 +812,11 @@ Status runAggregate(OperationContext* opCtx,
}
// Assert that a change stream on the config server is always opened on the oplog.
- tassert(6763400,
- str::stream() << "Change stream was unexpectedly opened on the namespace: "
- << nss << " in the config server",
- serverGlobalParams.clusterRole != ClusterRole::ConfigServer || nss.isOplog());
+ tassert(
+ 6763400,
+ str::stream() << "Change stream was unexpectedly opened on the namespace: " << nss
+ << " in the config server",
+ !serverGlobalParams.clusterRole.has(ClusterRole::ConfigServer) || nss.isOplog());
// Upgrade and wait for read concern if necessary.
_adjustChangeStreamReadConcern(opCtx);
@@ -925,7 +926,7 @@ Status runAggregate(OperationContext* opCtx,
// Set this operation's shard version for the underlying collection to unsharded.
// This is prerequisite for future shard versioning checks.
boost::optional<ScopedSetShardRole> scopeSetShardRole;
- if (serverGlobalParams.clusterRole != ClusterRole::None) {
+ if (!serverGlobalParams.clusterRole.has(ClusterRole::None)) {
scopeSetShardRole.emplace(opCtx,
resolvedView.getNamespace(),
ShardVersion::UNSHARDED() /* shardVersion */,