1.

Point out the correct statement.(a) The unique constraint on indexes ensures that only one document can have a value for a field in a collection(b) MongoDB support creating new unique indexes in sharded collections(c) If you use a compound shard key, you cannot enforce uniqueness on the combination of component keys in the shard key(d) All of the mentionedI had been asked this question during an interview.I'd like to ask this question from Sharded Cluster Data Management topic in portion Sharding Concepts, Mechanics and Sharded Cluster of MongoDB

Answer»

Right ANSWER is (a) The UNIQUE constraint on indexes ensures that only one document can have a value for a FIELD in a collection

For explanation: For sharded collections these unique indexes cannot ENFORCE uniqueness because INSERT and indexing operations are local to each shard.



Discussion

No Comment Found

Related InterviewSolutions