Complete the code to get the size of the array field 'scores'.
{ $size: "$ [1] " }The $size operator returns the number of elements in the array. Here, the array field is named scores.
Complete the code to get the first element of the 'grades' array using $arrayElemAt.
{ $arrayElemAt: [ "$grades", [1] ] }The $arrayElemAt operator uses zero-based indexing. To get the first element, use index 0.
Fix the error in the $filter expression to select elements greater than 10 from 'values'.
{ $filter: { input: "$values", as: "item", cond: { $gt: [ "$$ [1] ", 10 ] } } }The variable name used in as is item. To refer to it inside cond, use $$item.
Fill both blanks to filter 'scores' array for values less than 50 and get its size.
{ $size: { $filter: { input: "$scores", as: "score", cond: { $lt: [ "$$ [1] ", [2] ] } } } }The variable name is score as declared in as. The condition checks if score is less than 50.
Fill all three blanks to get the second element of filtered 'items' array where elements are greater than 5.
{ $arrayElemAt: [ { $filter: { input: "$items", as: "elem", cond: { $gt: [ "$$ [1] ", [2] ] } } }, [3] ] }The variable name is elem. The condition filters elements greater than 5. The second element has index 1.