Skip to content

How to handle array of objects? #421

Description

@ChhaviPoddar

Usecase: Is there any equipment with type embroidery and setting speed 250?

Fact:

const facts = {
	equipmentList: [
		{ type: 'embroidery', setting: { speed: 250 } },
		{ type: 'sewing', setting: { speed: 150 } },
	],
	substrate: { color: { hexcode: '#FFFFFF' } },
	Size: 'S',
};

// the following IS NOT working as expected. no matter what 'setting.speed' I give, I am getting true for the condition

{
  "all": [
    {
      "fact": "equipmentList",
      "path": "$[?(@.type == 'sewing' && @.setting.speed == 250)]",
      "operator": "notEqual",
      "value": []
    },
  ]
}

Does the package support this kind of a usecase?

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions