diff options
Diffstat (limited to 'jstests/core/fts_proj.js')
-rw-r--r-- | jstests/core/fts_proj.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/jstests/core/fts_proj.js b/jstests/core/fts_proj.js new file mode 100644 index 00000000000..1ecc6688d1b --- /dev/null +++ b/jstests/core/fts_proj.js @@ -0,0 +1,20 @@ +t = db.text_proj; +t.drop(); + +t.save( { _id : 1 , x : "a", y: "b", z : "c"}); +t.save( { _id : 2 , x : "d", y: "e", z : "f"}); +t.save( { _id : 3 , x : "a", y: "g", z : "h"}); + +t.ensureIndex( { x : "text"} , { default_language : "none" } ); + +res = t.runCommand("text", {search : "a"}); +assert.eq( 2, res.results.length ); +assert( res.results[0].obj.y, tojson(res) ); + +res = t.runCommand("text", {search : "a", project: {x: 1}}); +assert.eq( 2, res.results.length ); +assert( !res.results[0].obj.y, tojson(res) ); + + + + |