Skip to content
This repository was archived by the owner on Dec 12, 2018. It is now read-only.
This repository was archived by the owner on Dec 12, 2018. It is now read-only.

Filtering collections isn't working properly #569

@msl-kabo

Description

@msl-kabo

Code:

          account.getGroupMemberships({expand: 'group'}, (err, memberships) => {
            memberships.filter((membership, next) => {
              console.log('checking if membership should be included', membership.group.name);
              const test = membership.group.name.startsWith('myString');
              console.log('will be included?', test);
              next(null, test);
            }, (err, memberships) => {
              console.log('got filtered group memberships', err, memberships);
            });
          });

Output:

checking if membership should be included myString:831f9e62cd
will be included? true
checking if membership should be included myString:831f9e62cd/example:34a800114c
will be included? true
checking if membership should be included stuff:831f9e62cd/example:34a800114c
will be included? false
got filtered group memberships [] undefined

I would expect err to be undefined and memberships to contain the two first memberships. Documentation: https://docs.stormpath.com/nodejs/jsdoc/CollectionResource.html#filter__anchor

Using stormpath 0.18.5 on node 6.9.1.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions