OpenSearch/rest-api-spec/test/update/22_doc_as_upsert.yaml
2014-01-07 16:19:06 +01:00

42 lines
768 B
YAML

---
"Doc as upsert":
- do:
update:
index: test_1
type: test
id: 1
body:
doc: { foo: bar, count: 1 }
doc_as_upsert: 1
- do:
get:
index: test_1
type: test
id: 1
- match: { _source.foo: bar }
- match: { _source.count: 1 }
- do:
update:
index: test_1
type: test
id: 1
body:
doc: { count: 2 }
doc_as_upsert: 1
- do:
get:
index: test_1
type: test
id: 1
- match: { _source.foo: bar }
- match: { _source.count: 2 }