SDK
SDK Golang v3.x
2

Delete #

Deletes a document.

The optional parameter refresh can be used with the value wait_for in order to wait for the document to be indexed (and to no longer be available in search).

Arguments #

Delete(
  index string,
  collection string,
  _id string,
  options types.QueryOptions) (string, error)

ArgumentTypeDescription
index
string
Index name
collection
string
Collection name
id
string
Document ID
options
types.QueryOptions
A struct containing query options

options #

Additional query options

OptionType
(default)
Description
Queuable
bool

(true)
If true, queues the request during downtime, until connected to Kuzzle again
Refresh
string

("")
If set to wait_for, waits for the change to be reflected for search (up to 1s)

Return #

Returns the id of the deleted document.

Usage #

id, err := kuzzle.Document.Delete("nyc-open-data", "yellow-taxi", "some-id", nil)
if err != nil {
  log.Fatal(err)
} else if id == "some-id" {
  fmt.Println("Success")
}