// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.update({
  index: 'sessions',
  id: 'dh3sgudg8gsrgl',
  body: {
    scripted_upsert: true,
    script: {
      id: 'my_web_session_summariser',
      params: {
        pageViewEvent: {
          url: 'foo.com/bar',
          response: 404,
          time: '2014-01-01 12:32'
        }
      }
    },
    upsert: {}
  }
})
console.log(response)
----

