diff --git a/doc/7/controllers/collection/list/index.md b/doc/7/controllers/collection/list/index.md index c6b5f6d55..753557a25 100644 --- a/doc/7/controllers/collection/list/index.md +++ b/doc/7/controllers/collection/list/index.md @@ -19,7 +19,7 @@ list(index, [options]);
| Arguments | Type | Description | -| --------- | ----------------- | ------------- | +|-----------|-------------------|---------------| | `index` |
string
| Index name | | `options` |
object
| Query options | @@ -28,26 +28,26 @@ list(index, [options]); Additional query options | Property | Type
(default) | Description | -| ---------- | ------------------------------- | ---------------------------------------------------------------------------- | +|------------|---------------------------------|------------------------------------------------------------------------------| | `queuable` |
boolean

(`true`) | If true, queues the request during downtime, until connected to Kuzzle again | -| `from` |
number

(`0`) | Offset of the first result | -| `size` |
number

(`10`) | Maximum number of returned results | +| `from` |
number

(`0`) | Offset of the first result | +| `size` |
number

(`10`) | Maximum number of returned results | ## Resolves Resolves to an object containing the following properties: | Property | Type | Description | -| ------------- | ------------------- | ------------------------------------------------------------------ | +|---------------|---------------------|--------------------------------------------------------------------| | `type` |
string
| Types of returned collections
(`all`, `realtime` or `stored`) | | `collections` |
object[]
| List of collections | -| `from` |
number
| Offset of the first result | -| `size` |
number
| Maximum number of returned results | +| `from` |
number
| Offset of the first result | +| `size` |
number
| 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`) | diff --git a/src/controllers/Collection.js b/src/controllers/Collection.js index 53311c243..c7bc36456 100644 --- a/src/controllers/Collection.js +++ b/src/controllers/Collection.js @@ -71,8 +71,8 @@ class CollectionController extends BaseController { const request = { index, action: 'list', - from: options.from, - size: options.size + size: options.size || 0, + from: options.from }; delete options.from; delete options.size; diff --git a/test/controllers/collection.test.js b/test/controllers/collection.test.js index 3c6321a23..7e9e70f1b 100644 --- a/test/controllers/collection.test.js +++ b/test/controllers/collection.test.js @@ -220,8 +220,8 @@ describe('Collection Controller', () => { controller: 'collection', action: 'list', index: 'index', - from: undefined, - size: undefined + size: 0, + from: undefined }, options); should(res).match({