okta-sdk-nodejs icon indicating copy to clipboard operation
okta-sdk-nodejs copied to clipboard

Collection async iteration does not work if only one element is in the collection

Open welljsjs opened this issue 4 years ago • 1 comments

Your docs state that:

If you're using a version of Node 10 or greater, you can use async iterators.

for await (let user of client.listUsers()) {
   console.log(user);
}

For more information about this API see Users: Get User. (source: https://github.com/okta/okta-sdk-nodejs#list-all-org-users)

This does not work if there's only one element in the collection.

Fixed by #191

welljsjs avatar Aug 10 '20 18:08 welljsjs

@welljsjs Thanks for reporting the issue. I am working on the PR, meanwhile, you can use .each method from collection as a workaround.

shuowu avatar Aug 11 '20 16:08 shuowu