Prism · Sugar

$take

The first elements of a list, as many as asked for. Shorthand for a $slice from the start.

The source
{ numbers: [10, 20, 30, 40, 50, 60, 70, 80] }
The config
{ $take: { from: { $ref: '$.numbers' }, count: 3 } }
What comes out
[10, 20, 30]
Output matches the expected value

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