SDK
SDK Golang v1.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.

MGet #

Gets multiple documents.

Returns a partial error (error code 206) if one or more document can not be retrieved.

Arguments #

Copied to clipboard!
MGet(
    index string,
    collection string,
    ids []string,
    options types.QueryOptions) (json.RawMessage, error)

Arguments Type Description
index
string
Index name
collection
string
Collection name
ids
[]string
Document IDs
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

Return #

Returns a json.RawMessage containing the retrieved documents.

Usage #

Copied to clipboard!
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)
ids := []string{"some-id", "some-other-id"}
response, err := kuzzle.Document.MGet("nyc-open-data", "yellow-taxi", ids, nil)
if err != nil {
  log.Fatal(err)
} else {
  fmt.Println(string(response))
  fmt.Println("Success")
}