diff options
author | Benety Goh <benety@mongodb.com> | 2018-09-28 14:00:26 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2018-09-28 14:00:26 -0400 |
commit | 15d15831540f2b59a889bdcb3fcf9725d6a23c96 (patch) | |
tree | 49a408f265ced03fee657c69d422f12f3369eb94 /jstests/core | |
parent | 606ed0eda1b0e3f0da66d63fd8a2e262cd0edc8b (diff) | |
download | mongo-15d15831540f2b59a889bdcb3fcf9725d6a23c96.tar.gz |
Revert "SERVER-37333 applyOps validates both background and foreground indexes for system.indexes inserts"
This reverts commit 606ed0eda1b0e3f0da66d63fd8a2e262cd0edc8b.
Diffstat (limited to 'jstests/core')
-rw-r--r-- | jstests/core/apply_ops_invalid_index_spec.js | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/jstests/core/apply_ops_invalid_index_spec.js b/jstests/core/apply_ops_invalid_index_spec.js index 2ca88081fa7..d4d9b73ff05 100644 --- a/jstests/core/apply_ops_invalid_index_spec.js +++ b/jstests/core/apply_ops_invalid_index_spec.js @@ -54,54 +54,4 @@ o: {v: 1, key: {a: 1}, name: 'a_1_system_v1', ns: collNs, unknown: 1}, }], })); - - // - // Background indexes should be subject to the same level of validation as foreground indexes. - // - - // Inserting a background index directly into system.indexes with a bad index key pattern should - // return an error. - assert.commandFailedWithCode(db.adminCommand({ - applyOps: [{ - op: 'i', - ns: systemIndexesNs, - o: {key: {b: 'sideways'}, name: 'b_1_bg_system_v2', ns: collNs, background: true}, - }], - }), - ErrorCodes.CannotCreateIndex); - - // Inserting a v:2 background index directly into system.indexes with an unknown field in the - // index spec should return an error. - assert.commandFailedWithCode(db.adminCommand({ - applyOps: [{ - op: 'i', - ns: systemIndexesNs, - o: { - v: 2, - key: {b: 1}, - name: 'b_1_bg_system_v2', - ns: collNs, - background: true, - unknown: true, - }, - }], - }), - ErrorCodes.InvalidIndexSpecificationOption); - - // Inserting a background v:1 index directly into system.indexes with an unknown field in the - // index spec should work. - assert.commandWorked(db.adminCommand({ - applyOps: [{ - op: 'i', - ns: systemIndexesNs, - o: { - v: 1, - key: {b: 1}, - name: 'b_1_bg_system_v1', - ns: collNs, - background: true, - unknown: true, - }, - }], - })); })(); |