SDK
SDK Jvm v1.x
2

list #

Returns the list of collections associated to a provided index. The returned list is sorted in alphanumerical order.


:::: tabs ::: tab Java

Arguments #

Copied to clipboard!
public CompletableFuture<Map<String, Object>> list(
      final String index) throws NotConnectedException, InternalException
Arguments Type Description
index
String
Index name

Returns #

Returns a Map<String, Object> containing the following properties:

Property Type Description
type
String
Types of returned collections
(all, realtime or stored)
collections
ArrayList
List of collections
from
Integer
Offset of the first result
size
Integer
Maximum number of returned results

Each object in the collections array contains the following properties:

Property Type Description
name
String
Collection name
type
String
Collection type (realtime or stored)

Usage #

Copied to clipboard!
Map<String, Object> result = kuzzle
  .getCollectionController()
  .list("nyc-open-data")
  .get();
/*
  {
    size=10,
    collections=[
      {
        name=dark-taxi,
        type=stored
      },
      {
        name=pink-taxi,
        type=stored
      }
     ],
    from=0,
    type=all
   }
 */

::: ::: tab Kotlin

Arguments #

Copied to clipboard!
fun list(index: String): CompletableFuture<Map<String, Any?>>
Arguments Type Description
index
String
Index name

Returns #

Returns a Map<String, Any?> containing the following properties:

Property Type Description
type
String
Types of returned collections
(all, realtime or stored)
collections
ArrayList
List of collections
from
Int
Offset of the first result
size
Int
Maximum number of returned results

Each object in the collections array contains the following properties:

Property Type Description
name
String
Collection name
type
String
Collection type (realtime or stored)

Usage #

Copied to clipboard!
val result = kuzzle
  .collectionController
  .list("nyc-open-data")
  .get()
/*
  {
    size=10,
    collections=[
      {
        name=dark-taxi,
        type=stored
      },
      {
        name=pink-taxi,
        type=stored
      }
     ],
    from=0,
    type=all
   }
 */

::: ::::