diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2015-11-11 11:26:07 -0500 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2015-11-11 14:29:00 -0500 |
commit | 547d3bc47066f780379dc388ae11e87d210f800c (patch) | |
tree | 0511db54d0eadbe7d286dce8484ae7ab961d0de9 /jstests/core/fts_index.js | |
parent | 78fa7169e13faa8d371d76413db06ec5520f4bf8 (diff) | |
download | mongo-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.js | 8 |
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. // |