Prism · Sugar

$pluck

One field out of every record of a list. Shorthand for a $map whose body is a $get of that key.

The source
{
  users: [
    { id: 'u1', name: 'Ada' },
    { id: 'u2', name: 'Grace' },
    { id: 'u3', name: 'Linus' },
  ],
}
The config
{ $pluck: { over: { $ref: '$.users' }, key: 'name' } }
What comes out
['Ada', 'Grace', 'Linus']
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.