summaryrefslogtreecommitdiff
path: root/src/mongo/s/cluster_commands_helpers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/s/cluster_commands_helpers.h')
-rw-r--r--src/mongo/s/cluster_commands_helpers.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/s/cluster_commands_helpers.h b/src/mongo/s/cluster_commands_helpers.h
index 096a04019e1..b66f3a2f95f 100644
--- a/src/mongo/s/cluster_commands_helpers.h
+++ b/src/mongo/s/cluster_commands_helpers.h
@@ -65,6 +65,18 @@ void appendWriteConcernErrorToCmdResponse(const ShardId& shardID,
std::unique_ptr<WriteConcernErrorDetail> getWriteConcernErrorDetailFromBSONObj(const BSONObj& obj);
/**
+ * Makes an expression context suitable for canonicalization of queries that contain let parameters
+ * and runtimeConstants on mongos.
+ */
+boost::intrusive_ptr<ExpressionContext> makeExpressionContextWithDefaultsForTargeter(
+ OperationContext* opCtx,
+ const NamespaceString& nss,
+ const BSONObj& collation,
+ const boost::optional<ExplainOptions::Verbosity>& verbosity,
+ const boost::optional<BSONObj>& letParameters,
+ const boost::optional<RuntimeConstants>& runtimeConstants);
+
+/**
* Consults the routing info to build requests for:
* 1. If sharded, shards that own chunks for the namespace, or
* 2. If unsharded, the primary shard for the database.