diff options
author | David Storch <david.storch@10gen.com> | 2014-03-05 16:54:14 -0500 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2014-03-10 16:02:02 -0400 |
commit | 25596dbf48b18a76d3d2cdfdf1fcf23a43e46316 (patch) | |
tree | cf8a0e5225fad6b165d09f20feaec99d06a8ecc5 /jstests/core/fts6.js | |
parent | 629de3b0f493ad7517b2aecd6ec616df015f53dc (diff) | |
download | mongo-25596dbf48b18a76d3d2cdfdf1fcf23a43e46316.tar.gz |
SERVER-13039 handle subnodes which require an index during plan enumeration
Diffstat (limited to 'jstests/core/fts6.js')
-rw-r--r-- | jstests/core/fts6.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/core/fts6.js b/jstests/core/fts6.js new file mode 100644 index 00000000000..15c537bb235 --- /dev/null +++ b/jstests/core/fts6.js @@ -0,0 +1,16 @@ +// SERVER-13039. Confirm that we return the right results when $text is +// inside an $or. + +var t = db.jstests_fts6; +t.drop(); + +t.ensureIndex({a: 1}); +t.ensureIndex({b: "text"}); + +t.save({_id: 1, a: 0}); +t.save({_id: 2, a: 0, b: "foo"}); + +var cursor = t.find({a: 0, $or: [{_id: 2}, {$text: {$search: "foo"}}]}); +var results = cursor.toArray(); +assert.eq(1, results.length, "unexpected number of results"); +assert.eq(2, results[0]["_id"], "unexpected document returned"); |