SDK
SDK Golang v2.x
1

You are currently looking at the documentation of a previous version of Kuzzle. We strongly recommend that you use the latest version. You can also use the version selector in the top menu.

MDelete #

Deletes multiple documents.

Throws a partial error (error code 206) if one or more document deletions fail.

The optional parameter refresh can be used with the value wait_for in order to wait for the document indexation (indexed documents are available for search).

Arguments #

MDelete(  index string,  collection string,  ids []string,  options types.QueryOptions) ([]string, error)

ArgumentTypeDescription
index
string
Index name
collection
string
Collection name
ids
[]string
The ids of the documents to delete
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 an array of strings containing the ids of the deleted documents.

Usage #

ids := []string{"some-id", "some-other-id"} kuzzle.Document.Create(  "nyc-open-data",  "yellow-taxi",  "some-id",  json.RawMessage(`{}`),  nil) kuzzle.Document.Create(  "nyc-open-data",  "yellow-taxi",  "some-other-id",  json.RawMessage(`{}`),  nil) deleted, err := kuzzle.Document.MDelete("nyc-open-data", "yellow-taxi", ids, nil) if err != nil {  log.Fatal(err) } else {  fmt.Printf("Successfully deleted %d documents", len(deleted)) }