Pipeline Practice

MongoDB $arrayElemAt

Read the array element at a particular position.

Indexes begin at `0`; negative indexes count backward from the end. This reads one value without unwinding the entire array.

Array expressions inspect or transform an array without creating a separate document for every element. These are supported in the playground for further practice.

Course use: Supported in the playground.

Example pipeline syntax

{ $arrayElemAt: ["$items", 0] }