summaryrefslogtreecommitdiff
path: root/jstests/fts_proj.js
blob: 1ecc6688d1b78ef1e8447d4cc02a419d9f763319 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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) );