summaryrefslogtreecommitdiff
path: root/jstests/core/fts_index.js
diff options
context:
space:
mode:
authorCharlie Swanson <charlie.swanson@mongodb.com>2015-11-11 11:26:07 -0500
committerCharlie Swanson <charlie.swanson@mongodb.com>2015-11-11 14:29:00 -0500
commit547d3bc47066f780379dc388ae11e87d210f800c (patch)
tree0511db54d0eadbe7d286dce8484ae7ab961d0de9 /jstests/core/fts_index.js
parent78fa7169e13faa8d371d76413db06ec5520f4bf8 (diff)
downloadmongo-547d3bc47066f780379dc388ae11e87d210f800c.tar.gz
SERVER-19519 Disallow creating an index with key '_fts'
Diffstat (limited to 'jstests/core/fts_index.js')
-rw-r--r--jstests/core/fts_index.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/jstests/core/fts_index.js b/jstests/core/fts_index.js
index d5e5867a182..5410b8c4ca2 100644
--- a/jstests/core/fts_index.js
+++ b/jstests/core/fts_index.js
@@ -34,6 +34,14 @@ assert.commandFailed(coll.ensureIndex({"a.$**": "text"}, {name: indexName}));
assert.eq( 0, coll.getIndexes().filter( function(z){ return z.name == indexName; } ).length );
coll.dropIndexes();
+// SERVER-19519 Spec fails if '_fts' is specified on a non-text index.
+assert.commandFailed(coll.ensureIndex({_fts: 1}, {name: indexName}));
+assert.eq( 0, coll.getIndexes().filter( function(z){ return z.name == indexName; } ).length );
+coll.dropIndexes();
+assert.commandFailed(coll.ensureIndex({_fts: "text"}, {name: indexName}));
+assert.eq( 0, coll.getIndexes().filter( function(z){ return z.name == indexName; } ).length );
+coll.dropIndexes();
+
//
// 2. Text indexes properly enforce a schema on the language_override field.
//