summaryrefslogtreecommitdiff
path: root/jstests/core/bindata_indexonly.js
diff options
context:
space:
mode:
authorMark Benvenuto <mark.benvenuto@mongodb.com>2016-08-15 11:59:40 -0400
committerMark Benvenuto <mark.benvenuto@mongodb.com>2016-08-15 11:59:40 -0400
commitea024d2e812b0f66b8c4110f023a6787dd695531 (patch)
tree843715576e9d4697c8ceca78dde28cf5af3c3029 /jstests/core/bindata_indexonly.js
parentd22cd69f5190c8dbafd854186542c8a2948b58e7 (diff)
downloadmongo-ea024d2e812b0f66b8c4110f023a6787dd695531.tar.gz
SERVER-25539 Validate BinData private object
Diffstat (limited to 'jstests/core/bindata_indexonly.js')
-rw-r--r--jstests/core/bindata_indexonly.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/jstests/core/bindata_indexonly.js b/jstests/core/bindata_indexonly.js
index a8a2d281560..80ad3759104 100644
--- a/jstests/core/bindata_indexonly.js
+++ b/jstests/core/bindata_indexonly.js
@@ -17,6 +17,10 @@
assert.writeOK(coll.insert({_id: BinData(0, "////////////////////////////"), a: 4}));
assert.commandWorked(coll.createIndex({_id: 1, a: 1}));
+ assert.throws(function() {
+ db.mycoll.insert({_id: 0, a: BinData.prototype});
+ }, null, "bindata getter did not fail");
+
function testIndexOnlyBinData(blob) {
var explain =
coll.find({$and: [{_id: {$lte: BinData(0, blob)}}, {_id: {$gte: BinData(0, blob)}}]},
@@ -71,4 +75,4 @@
"correctcount.$gte.3 - not returning correct documents");
coll.drop();
-})(); \ No newline at end of file
+})();