Complete the code to concatenate first and last names with a space in between.
{ $concat: ["$firstName", [1], "$lastName"] }We use a space " " to separate first and last names when concatenating.
Complete the code to convert the 'city' field to uppercase.
{ $toUpper: "$[1]" }Field names are case-sensitive and usually lowercase; use "$city" to refer to the field.
Fix the error in the code to convert 'country' field to lowercase.
{ $toLower: "$[1]" }The field name must match exactly, so use "$country" in lowercase.
Fill both blanks to concatenate first name and last name in uppercase with a space in between.
{ $concat: [ { $toUpper: "$firstName" }, [1], { $toUpper: "$lastName" } ] }We use a space " " to separate the uppercase first and last names when concatenating.
Fill all three blanks to concatenate lowercase city and uppercase country with a comma and space in between.
{ $concat: [ { $toLower: "$[1]" }, [2], { $toUpper: "$[3]" } ] }We convert city to lowercase, country to uppercase, and separate them with a comma and space ", ".