From 3a5326d9b4a54f6df5d4307f4fc73bcc94212d43 Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 4 Apr 2011 18:14:58 -0700 Subject: SERVER-2322 Allow specification of non boolean value with exists operator --- jstests/exists7.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 jstests/exists7.js (limited to 'jstests/exists7.js') diff --git a/jstests/exists7.js b/jstests/exists7.js new file mode 100644 index 00000000000..afc54b7ca06 --- /dev/null +++ b/jstests/exists7.js @@ -0,0 +1,17 @@ +// Test that non boolean value types are allowed with $explain spec. SERVER-2322 + +t = db.jstests_explain7; +t.drop(); + +function testIntegerExistsSpec() { + t.drop(); + t.save( {} ); + t.save( {a:1} ); + + assert.eq( 1, t.count( {a:{$exists:1}} ) ); + assert.eq( 1, t.count( {a:{$exists:0}} ) ); +} + +testIntegerExistsSpec(); +t.ensureIndex( {a:1} ); +testIntegerExistsSpec(); -- cgit v1.2.1