Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add from and size parameters in the listCollections route #518

Merged
merged 5 commits into from
Nov 10, 2016

Conversation

dbengsch
Copy link
Contributor

@dbengsch dbengsch commented Nov 4, 2016

fix #440

Response format has changed.
Previously:

{
  collections: {
    realtime: [
      'realtimeCollection',
      '...'
    ],
    stored: {
      'storedCollection',
      '...'
    }
  }
  type: 'all'
}

Now:

{
  collections: [
    {name: 'realtimeCollection', type: 'realtime'},
    {name: 'storedCollection', type: 'stored'},
    {...}
  }
  type: 'all'
  from: 0,
  size: 12
}

Collections are sorted alphanumerically. from and size appear in the response only if they have been used in the request.

@codecov-io
Copy link

codecov-io commented Nov 4, 2016

Current coverage is 97.34% (diff: 100%)

Merging #518 into develop will increase coverage by 0.01%

@@            develop       #518   diff @@
==========================================
  Files           116        116          
  Lines          5921       5947    +26   
  Methods         613        615     +2   
  Messages          0          0          
  Branches       1145       1152     +7   
==========================================
+ Hits           5763       5789    +26   
  Misses          158        158          
  Partials          0          0          

Powered by Codecov. Last update 6664a0e...0817fd6

@@ -83,16 +84,21 @@ function ReadController (kuzzle) {
.map(collection => collection.name);

if (type === 'realtime') {
return kuzzle.pluginsManager.trigger('data:afterListCollections', new ResponseObject(modifiedRequestObject, {type, collections: {realtime: realtimeCollections}}));
let realtimeResponse = {type, collections: {realtime: realtimeCollections}};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have we already all agreed node 6 is a strong requirement?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be leveraged for the time being using strict mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benoitvidis I think we did already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@benoitvidis added a 'use strict'

@stafyniaksacha stafyniaksacha merged commit 7c09349 into develop Nov 10, 2016
@stafyniaksacha stafyniaksacha deleted the feature-440-collection-from-size branch November 10, 2016 16:54
@dbengsch dbengsch mentioned this pull request Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants