SDK
SDK Golang v1.x
1

# 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

Copied to clipboard!
Delete(
  index string,
  collection string,
  _id string,
  options types.QueryOptions) (string, error)

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

# options

Additional query options

Option Type
(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

Copied to clipboard!
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")
}