summaryrefslogtreecommitdiff
path: root/jstests/core/profile_find.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/core/profile_find.js')
-rw-r--r--jstests/core/profile_find.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/jstests/core/profile_find.js b/jstests/core/profile_find.js
index 36116c5a6fa..d49aa30bc9f 100644
--- a/jstests/core/profile_find.js
+++ b/jstests/core/profile_find.js
@@ -154,4 +154,19 @@
assert.eq(coll.find().snapshot().itcount(), 1);
profileObj = getLatestProfilerEntry(testDB, profileEntryFilter);
assert.eq(profileObj.query.snapshot, true, tojson(profileObj));
+
+ //
+ // Confirm that queries are truncated in the profiler as { $truncated: <string>, comment:
+ // <string> }
+ //
+ let queryPredicate = {};
+
+ for (let i = 0; i < 501; i++) {
+ queryPredicate[i] = "a".repeat(150);
+ }
+
+ assert.eq(coll.find(queryPredicate).comment("profile_find").itcount(), 0);
+ profileObj = getLatestProfilerEntry(testDB, profileEntryFilter);
+ assert.eq((typeof profileObj.query.$truncated), "string", tojson(profileObj));
+ assert.eq(profileObj.query.comment, "profile_find", tojson(profileObj));
})();