summaryrefslogtreecommitdiff
path: root/jstests/core/apply_ops1.js
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@10gen.com>2018-08-27 13:06:38 -0400
committerDianna Hohensee <dianna.hohensee@10gen.com>2018-08-29 16:47:09 -0400
commit4cb0742947dabee476c9979cae39c728a21568d5 (patch)
tree8ec6baacaab48a11b20eae4781f32be1bdad6ec2 /jstests/core/apply_ops1.js
parentaa36a9e8ad8c98e828f1b53966672b368d973380 (diff)
downloadmongo-4cb0742947dabee476c9979cae39c728a21568d5.tar.gz
SERVER-36015 Remove references to system.namespaces and system.indexes
Diffstat (limited to 'jstests/core/apply_ops1.js')
-rw-r--r--jstests/core/apply_ops1.js135
1 files changed, 0 insertions, 135 deletions
diff --git a/jstests/core/apply_ops1.js b/jstests/core/apply_ops1.js
index e71c33ad9b6..0b098bed8a0 100644
--- a/jstests/core/apply_ops1.js
+++ b/jstests/core/apply_ops1.js
@@ -212,82 +212,6 @@
}),
"Excessively nested applyOps should be rejected");
- // Missing 'o' field value in an operation of type 'i' on 'system.indexes' collection.
- assert.commandFailedWithCode(
- db.adminCommand({applyOps: [{op: 'i', ns: db.getName() + '.system.indexes'}]}),
- ErrorCodes.NoSuchKey,
- 'applyOps should fail on system.indexes insert operation without "o" field');
-
- // Non-object 'o' field value in an operation of type 'i' on 'system.indexes' collection.
- assert.commandFailedWithCode(
- db.adminCommand({applyOps: [{op: 'i', ns: db.getName() + '.system.indexes', o: 'bar'}]}),
- ErrorCodes.TypeMismatch,
- 'applyOps should fail on system.indexes insert operation with non-object "o" field');
-
- // Missing 'ns' field in index spec.
- assert.commandFailedWithCode(
- db.adminCommand({
- applyOps: [{
- op: 'i',
- ns: db.getName() + '.system.indexes',
- o: {
- key: {a: 1},
- name: 'a_1',
- }
- }]
- }),
- ErrorCodes.NoSuchKey,
- 'applyOps should fail on system.indexes insert operation with missing index namespace');
-
- // Non-string 'ns' field in index spec.
- assert.commandFailedWithCode(
- db.adminCommand({
- applyOps: [{
- op: 'i',
- ns: db.getName() + '.system.indexes',
- o: {
- ns: 12345,
- key: {a: 1},
- name: 'a_1',
- }
- }]
- }),
- ErrorCodes.TypeMismatch,
- 'applyOps should fail on system.indexes insert operation with non-string index namespace');
-
- // Invalid 'ns' field in index spec.
- assert.commandFailedWithCode(
- db.adminCommand({
- applyOps: [{
- op: 'i',
- ns: db.getName() + '.system.indexes',
- o: {
- ns: 'invalid_namespace',
- key: {a: 1},
- name: 'a_1',
- }
- }]
- }),
- ErrorCodes.InvalidNamespace,
- 'applyOps should fail on system.indexes insert operation with invalid index namespace');
-
- // Inconsistent database name in index spec namespace.
- assert.commandFailedWithCode(
- db.adminCommand({
- applyOps: [{
- op: 'i',
- ns: db.getName() + '.system.indexes',
- o: {
- ns: 'baddbprefix' + t.getFullName(),
- key: {a: 1},
- name: 'a_1',
- }
- }]
- }),
- ErrorCodes.InvalidNamespace,
- 'applyOps should fail on system.indexes insert operation with index namespace containing ' +
- 'inconsistent database name');
-
// Valid 'ns' field value in unknown operation type 'x'.
assert.commandFailed(
db.adminCommand({applyOps: [{op: 'x', ns: t.getFullName()}]}),
@@ -476,65 +400,6 @@
assert.eq(true, res.results[1], "Valid update with transaction number failed");
assert.eq(true, res.results[2], "Valid delete with transaction number failed");
- // Foreground index build.
- res = assert.commandWorked(db.adminCommand({
- applyOps: [{
- "op": "i",
- "ns": db.getName() + ".system.indexes",
- "o": {
- ns: t.getFullName(),
- key: {a: 1},
- name: "a_1",
- }
- }]
- }));
- assert.eq(1, res.applied, "Incorrect number of operations applied");
- assert.eq(true, res.results[0], "Foreground index creation failed");
- var allIndexes = t.getIndexes();
- var spec = GetIndexHelpers.findByName(allIndexes, "a_1");
- assert.neq(null, spec, "Foreground index 'a_1' not found: " + tojson(allIndexes));
- assert.eq(1, spec.v, "Expected v=1 index to be built since 'v' field was omitted");
-
- // Background indexes are created in the foreground when processed by applyOps.
- res = assert.commandWorked(db.adminCommand({
- applyOps: [{
- "op": "i",
- "ns": db.getName() + ".system.indexes",
- "o": {
- ns: t.getFullName(),
- key: {b: 1},
- name: "b_1",
- background: true,
- }
- }]
- }));
- assert.eq(1, res.applied, "Incorrect number of operations applied");
- assert.eq(true, res.results[0], "Background index creation failed");
- allIndexes = t.getIndexes();
- spec = GetIndexHelpers.findByName(allIndexes, "b_1");
- assert.neq(null, spec, "Background index 'b_1' not found: " + tojson(allIndexes));
- assert.eq(1, spec.v, "Expected v=1 index to be built since 'v' field was omitted");
-
- // Foreground v=2 index build.
- res = assert.commandWorked(db.adminCommand({
- applyOps: [{
- "op": "i",
- "ns": db.getName() + ".system.indexes",
- "o": {
- ns: t.getFullName(),
- key: {c: 1},
- name: "c_1",
- v: 2,
- }
- }]
- }));
- assert.eq(1, res.applied, "Incorrect number of operations applied");
- assert.eq(true, res.results[0], "Foreground v=2 index creation failed");
- allIndexes = t.getIndexes();
- spec = GetIndexHelpers.findByName(allIndexes, "c_1");
- assert.neq(null, spec, "Foreground index 'c_1' not found: " + tojson(allIndexes));
- assert.eq(2, spec.v, "Expected v=2 index to be built");
-
// When applying a "u" (update) op, we default to 'UpdateNode' update semantics, and $set
// operations add new fields in lexicographic order.
res = assert.commandWorked(db.adminCommand({