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.

advertisement

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.

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.

advertisement

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.

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.

Here’s the list of Best Reference Books in MongoDB.

advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn