summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/sbe/util/print_options.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/exec/sbe/util/print_options.h')
-rw-r--r--src/mongo/db/exec/sbe/util/print_options.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/db/exec/sbe/util/print_options.h b/src/mongo/db/exec/sbe/util/print_options.h
index cb6a58d6a0e..00f42b31fdb 100644
--- a/src/mongo/db/exec/sbe/util/print_options.h
+++ b/src/mongo/db/exec/sbe/util/print_options.h
@@ -41,6 +41,7 @@ public:
static constexpr size_t kDefaultBinDataMaxDisplayLength = 80;
static constexpr size_t kDefaultArrayObjectOrNestingMaxDepth = 10;
static constexpr size_t kDefaultUseTagForAmbiguousValues = false;
+ static constexpr size_t kNormalizeOutput = false;
size_t stringMaxDisplayLength() const {
return _stringMaxDisplayLength;
@@ -78,11 +79,25 @@ public:
return *this;
}
+ bool normalizeOutput() const {
+ return _normalizeOutput;
+ }
+
+ /**
+ * Sets whether the output should be normalized. A normalized output will be
+ * stable, determinisitc and platform independent.
+ */
+ PrintOptions& normalizeOutput(bool value) {
+ _normalizeOutput = value;
+ return *this;
+ }
+
private:
size_t _stringMaxDisplayLength = kDefaultStringMaxDisplayLength;
size_t _binDataMaxDisplayLength = kDefaultBinDataMaxDisplayLength;
size_t _arrayObjectOrNestingMaxDepth = kDefaultArrayObjectOrNestingMaxDepth;
bool _useTagForAmbiguousValues = kDefaultUseTagForAmbiguousValues;
+ bool _normalizeOutput = kNormalizeOutput;
};
} // namespace mongo::sbe