summaryrefslogtreecommitdiff
path: root/jstests/core/apply_ops1.js
diff options
context:
space:
mode:
authorMatthew Russotto <matthew.russotto@10gen.com>2017-06-06 12:50:29 -0400
committerMatthew Russotto <matthew.russotto@10gen.com>2017-06-06 12:50:48 -0400
commit080e4a8b916721e143968943201655735049c4ba (patch)
tree7f0db85a38fce7db14991884652f449921a3219b /jstests/core/apply_ops1.js
parenta0c20cd74f761789a5cb9dfaa8d390a971bbba2c (diff)
downloadmongo-080e4a8b916721e143968943201655735049c4ba.tar.gz
SERVER-28897 Update apply_ops1.js to only perform idempotent operations in applyOps
Diffstat (limited to 'jstests/core/apply_ops1.js')
-rw-r--r--jstests/core/apply_ops1.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/jstests/core/apply_ops1.js b/jstests/core/apply_ops1.js
index 8ce15b1df22..746bfa7a389 100644
--- a/jstests/core/apply_ops1.js
+++ b/jstests/core/apply_ops1.js
@@ -310,8 +310,8 @@
var res = assert.commandWorked(db.runCommand({
applyOps: [
- {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$inc: {x: 1}}},
- {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$inc: {x: 1}}}
+ {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$set: {x: 18}}},
+ {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$set: {x: 19}}}
]
}));
@@ -326,8 +326,8 @@
// preCondition fully matches
res = db.runCommand({
applyOps: [
- {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$inc: {x: 1}}},
- {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$inc: {x: 1}}}
+ {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$set: {x: 20}}},
+ {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$set: {x: 21}}}
],
preCondition: [{ns: t.getFullName(), q: {_id: 5}, res: {x: 19}}]
});
@@ -343,8 +343,8 @@
// preCondition doesn't match ns
res = db.runCommand({
applyOps: [
- {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$inc: {x: 1}}},
- {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$inc: {x: 1}}}
+ {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$set: {x: 22}}},
+ {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$set: {x: 23}}}
],
preCondition: [{ns: "foo.otherName", q: {_id: 5}, res: {x: 21}}]
});
@@ -354,8 +354,8 @@
// preCondition doesn't match query
res = db.runCommand({
applyOps: [
- {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$inc: {x: 1}}},
- {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$inc: {x: 1}}}
+ {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$set: {x: 22}}},
+ {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$set: {x: 23}}}
],
preCondition: [{ns: t.getFullName(), q: {_id: 5}, res: {x: 19}}]
});
@@ -364,8 +364,8 @@
res = db.runCommand({
applyOps: [
- {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$inc: {x: 1}}},
- {op: "u", ns: t.getFullName(), o2: {_id: 6}, o: {$inc: {x: 1}}}
+ {op: "u", ns: t.getFullName(), o2: {_id: 5}, o: {$set: {x: 22}}},
+ {op: "u", ns: t.getFullName(), o2: {_id: 6}, o: {$set: {x: 23}}}
]
});