Skip to content

$filter returns undefined in async mode #217

@dprentis

Description

@dprentis

I am not able to use the filter function in async mode. It always returns undefined ie.

const out = await new Promise((resolve) => {
  const expression = jsonata('$filter(data, function($d) { true })');
  expression.evaluate(input, {}, (err, value) => {
    console.log('ERROR?', err); // null
    resolve(value); // undefined
  });
});

data is a valid array and the expression data returns the array. Also using $filter in synchronous mode works as expected (using version 1.5.3).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions