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)| Arguments | Type | Description |
|---|---|---|
index | string | Index name |
options | types.QueryOptions | An object containing query options |
options #
Additional query options
| Property | Type | Description | Default |
|---|---|---|---|
queuable | bool | Make this request queuable or not | true |
from | int | Offset of the first result | 0 |
size | int | Maximum number of returned results | 10 |
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")
}