QuestionQ189

Design and implement data models

HOTSPOT -

You have a container that holds data about families. The following is a sample document.

Question Image

You run the following query against the container.

Question Image

For each of the following statements, select Yes if the statement is true. Otherwise, select No.

Yes or No
StatementsYesNo
Children who do not have parents defined will appear on the list
Children who have more than one pet will appear on the list multiple times
Children who do not have pets defined will appear on the list
Explanation

JOIN ch IN f.children returns a row for each child and does not require the top-level parents property, so children can be returned when parents are undefined. The query never joins the pets array, so multiple pets do not multiply result rows. A child without pets is still returned; ARRAY_LENGTH(ch.pets) ?? 0 yields 0 when the array-length expression is undefined.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!