From b6b2fdf5c26db35a7553e8069816dc7c8d2c0a5b Mon Sep 17 00:00:00 2001 From: Benety Goh Date: Tue, 4 Mar 2014 23:11:09 -0500 Subject: SERVER-12902 disallow queries with projections for id hack --- jstests/core/idhack.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'jstests/core/idhack.js') diff --git a/jstests/core/idhack.js b/jstests/core/idhack.js index 307a048ef2b..2c926d0f439 100644 --- a/jstests/core/idhack.js +++ b/jstests/core/idhack.js @@ -46,3 +46,8 @@ var skipExplain = t.find( query ).skip(1).explain(); print( "explain for skip query = " + tojson( skipExplain ) ); assert.neq( explain.cursor, skipExplain.cursor, "F1" ); +// ID hack cannot be used with projection. +var projectionExplain = t.find( query, { _id : 1 } ).explain(); +print( "explain for projection query = " + tojson( projectionExplain ) ); +assert.neq( explain.cursor, projectionExplain.cursor, "G1" ); + -- cgit v1.2.1