Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/oak_nest/modules/elasticsearch/deps.ts>Client#updateByQuery

Refer to nestjs to realize some common functions for Deno
Go to Latest
method Client.prototype.updateByQuery
import { Client } from "https://deno.land/x/oak_nest@v1.13.17/modules/elasticsearch/deps.ts";

update by query if you want to update by query, you must set the query param and script param like this:

const info = await client.updateByQuery({
  index: "myindex",
  query: {
    name: "Richard Hall",
  },
  script: {
    source: 'ctx._source.message = "updated2"',
  },
});

Or you can set the body param yourself like:

{
        query: {
          match: {
            name: "Richard Hall",
          },
        },
        "script": {
          "source": 'ctx._source.message = "updated"',
        },
      },

Parameters

params: UpdateByQueryParams
optional
options: ExOptions

Returns

Promise<UpdatedInfo>