Files
elasticsearch-js/docs/_examples/mget.asciidoc
Spencer 83a464ac66 Update docs to use async/await (#667)
* [docs] update readme and examples to use async/await

* [apis] regenerate (including updated examples)
2018-05-23 14:31:34 -07:00

26 lines
585 B
Plaintext

.An array of doc locations. Useful for getting documents from different indices.
[source,js]
---------
const response = await client.mget({
body: {
docs: [
{ _index: 'indexA', _type: 'typeA', _id: '1' },
{ _index: 'indexB', _type: 'typeB', _id: '1' },
{ _index: 'indexC', _type: 'typeC', _id: '1' }
]
}
});
---------
.An array of ids. You must also specify the `index` and `type` that apply to all of the ids.
[source,js]
---------
const response = await client.mget({
index: 'myindex',
type: 'mytype',
body: {
ids: [1, 2, 3]
}
});
---------