summaryrefslogtreecommitdiff
path: root/rest-api-spec/test/update/25_script_upsert.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'rest-api-spec/test/update/25_script_upsert.yaml')
-rw-r--r--rest-api-spec/test/update/25_script_upsert.yaml41
1 files changed, 41 insertions, 0 deletions
diff --git a/rest-api-spec/test/update/25_script_upsert.yaml b/rest-api-spec/test/update/25_script_upsert.yaml
new file mode 100644
index 0000000..64226b7
--- /dev/null
+++ b/rest-api-spec/test/update/25_script_upsert.yaml
@@ -0,0 +1,41 @@
+---
+"Script upsert":
+
+ - do:
+ update:
+ index: test_1
+ type: test
+ id: 1
+ body:
+ script: "ctx._source.foo = bar"
+ params: { bar: 'xxx' }
+ upsert: { foo: baz }
+
+ - do:
+ get:
+ index: test_1
+ type: test
+ id: 1
+
+ - match: { _source.foo: baz }
+
+
+ - do:
+ update:
+ index: test_1
+ type: test
+ id: 1
+ body:
+ script: "ctx._source.foo = bar"
+ params: { bar: 'xxx' }
+ upsert: { foo: baz }
+
+ - do:
+ get:
+ index: test_1
+ type: test
+ id: 1
+
+ - match: { _source.foo: xxx }
+
+