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.

List #

Returns the complete list of realtime and stored collections in requested index sorted by name in alphanumerical order. The from and size arguments allow pagination. They are returned in the response if provided.

Arguments #

List(index string, options types.QueryOptions) (json.RawMessage, error)
ArgumentsTypeDescription
index
string
Index name
options
types.QueryOptions
An object containing query options

options #

Additional query options

PropertyTypeDescriptionDefault
queuable
bool
Make this request queuable or nottrue
from
int
Offset of the first result0
size
int
Maximum number of returned results10

Return #

Return a json representation of the API return containing the collection list and an error is something was wrong.

Usage #

options := types.NewQueryOptions()
options.SetFrom(1)
options.SetSize(1)
list, err := kuzzle.Collection.List("mtp-open-data", options)
if err != nil {
  log.Fatal(err)
} else if list != nil {
  fmt.Println("Success")
}