Skip to content

[Question]: Array from single item #23

@Dekeyras

Description

@Dekeyras

Hey,

Is there a way to output an array of one item from a single object?

Input Object:
{ email: "a@example.com" }

Required output:
{ emails: [ { email: "a@example.com" }] }

I have tried the below but its not quite what I need.

{
  "emails": {
    "path": "$empty",
    "nested": {
      "email": {
        "path": "email"
      }
    }
  }
}

Also this is invalid:

{
  "emails": [{
    "path": "$empty",
    "nested": {
      "email": {
        "path": "email"
      }
    }
  }]
}

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