Final exam question 6 wording

“An index doesn’t become multikey until a document is inserted that has an array value.”

Is the array value assumed to be on an indexed field or not? The wording doesn’t say, and the correct answer depends on whether the exam assumes one or the other.

@ James_31476

You may assume that the array value is on an indexed field. MongoDB doesn’t notice any fields in the document that are not in the index – that’s why it’s got a “flexible schema”. Unlike SQL, which you are probably comparing it to, as you already know MongoDB does not define fields in a document in advance. Therefore no field not in an index is visible to the collection.

Hi @DHz Is there any possibility that you can rephrase your answer withouth double-negations? I hope it’s not an inconvenient.

1 Like

@ maulberto3

Well, I’ll try. How’s this work for you?

You may assume that the array value is on an indexed field. MongoDB will only notice any fields in the document that are in the index

:wink:

1 Like

Fair enough, thank you.