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

42 lines
727 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 }
- is_false: _source.count
2013-06-28 13:44:13 -04:00
- 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 }