OpenSearch/rest-api-spec/test/update/20_doc_upsert.yaml

42 lines
725 B
YAML
Raw Normal View History

2013-06-28 13:44:13 -04:00
---
"Doc upsert":
- do:
update:
index: test_1
type: test
id: 1
body:
doc: { foo: bar, count: 1 }
upsert: { foo: baz }
- do:
get:
index: test_1
type: test
id: 1
- match: { _source.foo: baz }
- not_ok: _source.count
- do:
update:
index: test_1
type: test
id: 1
body:
doc: { foo: bar, count: 1 }
upsert: { foo: baz }
- do:
get:
index: test_1
type: test
id: 1
- match: { _source.foo: bar }
- match: { _source.count: 1 }