Collection resource update by mdeggies · Pull Request #591 · stormpath/stormpath-sdk-node · GitHub
Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Collection resource update - #591

Open
mdeggies wants to merge 1 commit into
masterfrom
remove-missing-methods
Open

mdeggies wants to merge 1 commit into
masterfrom
remove-missing-methods

Conversation

@mdeggies

@mdeggies mdeggies commented Jan 6, 2017

Copy link
Copy Markdown
Member

Fixed broken collection resource method examples and removed docs for the methods that don't exist (collection.concatLimit(), collection.detectLimit(), collection.everyLimit(), collection.everySeries(), collection.filterLimit(),collection.mapLimit(), collection.rejectLimit(), collection.someLimit(), collection.someSeries(),collection.sortByLimit(), collection.sortBySeries()).

One thing to note, there are still some methods remaining that don't work as expected (all of the limit() methods, like collection.eachLimit() and collection.mapLimit()). The docs say they're supposed to be exactly like their parent methods but with an iterator, so for ex, eachLimit should look like this:

    function iterator(account, next) {
      console.log('Found account for ' + account.givenName + ' (' + account.email + ')');
      next();
    }

    function doneCallback(err) {
      if (!err) {
        console.log('All accounts have been visited.');
      }
    }

    application.getAccounts({ email: 'foo@example.com' }, function (err, collection) {
      if (!err) {
        collection.eachLimit(iterator, 2, doneCallback);
      }
    });

When I run this, though, it doesn't make it into any of the functions (iterator or doneCallback). Please take a look and let me know if they should be fixed here.

@the-overengineer

Copy link
Copy Markdown

@mdeggies

Copy link
Copy Markdown
Member Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants