MongoDB Questions and Answers – Map-Reduce

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Map-Reduce”.

1. Which of the following database command is used for mapreduce function?
a) mapReduce
b) mapperRed
c) redmap
d) none of the mentioned
View Answer

Answer: a
Explanation: For map-reduce operations, MongoDB provides the mapReduce database command.

2. MongoDB applies the _____ phase to each input document in mapreduce.
a) map
b) reduce
c) mapper
d) all of the mentioned
View Answer

Answer: a
Explanation: The map function emits key-value pairs.

3. MongoDB applies the _________ phase, which collects and condenses the aggregated data.
a) map
b) reduce
c) mapper
d) all of the mentioned
View Answer

Answer: b
Explanation: MongoDB then stores the results in a collection.

advertisement
advertisement

4. The output of the reduce function may pass through a ______ function to further condense or process the results of the aggregation.
a) finalize
b) filter
c) procedure
d) none of the mentioned
View Answer

Answer: a
Explanation: The input and the output collections may be sharded.

5. _________ can return the results of a map-reduce operation as a document, or may write the results to collections.
a) mapReduce
b) mapperRed
c) RedMap
d) none of the mentioned
View Answer

Answer: a
Explanation: Map-reduce operations take the documents of a single collection as the input and can perform any arbitrary sorting and limiting before beginning the map stage.

Note: Join free Sanfoundry classes at Telegram or Youtube

6. Map-reduce uses custom __________ functions to perform the map and reduce operations.
a) Java
b) Javascript
c) JSON
d) None of the mentioned
View Answer

Answer: b
Explanation: JavaScript provide great flexibility compared to the aggregation pipeline.

7. For most aggregation operations, the ______ Pipeline provides better performance and more coherent interface.
a) Aggregate
b) Replication
c) Sharding
d) None of the mentioned
View Answer

Answer: a
Explanation: Map-reduce operations provide some flexibility that is not presently available in the aggregation pipeline.

advertisement

8. What would be the maximum document size for results of mapreduce operation?
a) 15 MB
b) 16 MB
c) 17 MB
d) All of the mentioned
View Answer

Answer: b
Explanation: When returning the results of a map reduce operation inline, the result documents must be within the BSON Document Size limit, which is currently 16 megabytes.

Sanfoundry Global Education & Learning Series – MongoDB.

advertisement

Here’s the list of Best Books in MongoDB.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.