Open dtaivpp opened 1 year ago
Hey all, when attempting to use this code it tells me that an array is an invalid return type. Is this an issue with the JS library or with the documentation?
https://github.com/opensearch-project/documentation-website/blob/02f40d7efd4265e85c128d0a85a65c668c016b97/_clients/javascript/helpers.md?plain=1#L96C8-L102
let result = await os_client.helpers.bulk({ datasource: [{ body: "this is my text", id: 1234}], onDocument (doc) { return [ { index: { _index: index_name , _id: doc.id } }, {...doc, body: "instead have this body"} ] }
I would expect this to modify the body of the document and add it as a bulk action.
MacOS
Add any other context about the problem.
I can't recreate your error. What version of the client are you using? Does the trace log point out where the error occurs?
What is the bug?
Hey all, when attempting to use this code it tells me that an array is an invalid return type. Is this an issue with the JS library or with the documentation?
https://github.com/opensearch-project/documentation-website/blob/02f40d7efd4265e85c128d0a85a65c668c016b97/_clients/javascript/helpers.md?plain=1#L96C8-L102
How can one reproduce the bug?
What is the expected behavior?
I would expect this to modify the body of the document and add it as a bulk action.
What is your host/environment?
MacOS
Do you have any screenshots?
Do you have any additional context?
Add any other context about the problem.