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

[source, js]
----
const response = await client.sql.query({
  format: "txt",
  runtime_mappings: {
    release_day_of_week: {
      type: "keyword",
      script:
        "\n        emit(doc['release_date'].value.dayOfWeekEnum.toString())\n      ",
    },
  },
  query:
    "\n    SELECT * FROM library WHERE page_count > 300 AND author = 'Frank Herbert'\n  ",
});
console.log(response);
----
