diff options
author | Benety Goh <benety@mongodb.com> | 2014-03-04 23:11:09 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2014-03-06 20:20:06 -0500 |
commit | b6b2fdf5c26db35a7553e8069816dc7c8d2c0a5b (patch) | |
tree | e882ca385503a808b4c031acac8db3d8efdcd7ef /jstests/core/idhack.js | |
parent | 3b7a5187d788daa0544fb967e48653398054ed22 (diff) | |
download | mongo-b6b2fdf5c26db35a7553e8069816dc7c8d2c0a5b.tar.gz |
SERVER-12902 disallow queries with projections for id hack
Diffstat (limited to 'jstests/core/idhack.js')
-rw-r--r-- | jstests/core/idhack.js | 5 |
1 files changed, 5 insertions, 0 deletions
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" ); + |