Question about QUIZ in Chapter 3

Array should have same type of objects. Is it not right for Mongo arrays? Here attributes field have two different objects

{ "_id": 1,
  "pet": "cat",
  "attributes": [ { "coat": "fur",
                    "type": "soft" },
                  { "defense": "claws",
                    "location": "paws",
                    "nickname": "murder mittens" } ],
  "name": "Furball" }

Arrays can any type of element regardless what are the other elements.

The document you posted is valid.

2 Likes