1.

Point out the correct statement.(a) An equality match on the unique _id field is less selective as it can match at most one document(b) The selectivity of regular expressions depends on the expressions themselves(c) Less selective queries can use indexes effectively or even at all(d) All of the mentionedThis question was addressed to me in an interview.This question is from Analyze Query Performance in portion MongoDB CRUD Concepts and Operation of MongoDB

Answer»

Correct option is (b) The SELECTIVITY of regular expressions DEPENDS on the expressions themselves

The best EXPLANATION: If an index exists for the FIELD, then MongoDB matches the regular expression against the values in the index, which can be FASTER than a collection scan.



Discussion

No Comment Found

Related InterviewSolutions