MongoDB Questions and Answers – Model Data for Atomic operations

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Model Data for Atomic operations”.

1. Which of the following pattern is best for static trees that do not change?
a) Child
b) Parent
c) Root
d) None of the mentioned
View Answer

Answer: d
Explanation: The Nested Sets pattern provides a fast and efficient solution for finding subtrees but is inefficient for modifying the tree structure.

2. Point out the correct statement.
a) $regex is used for regular expression pattern matches
b) $like is used for regular expression pattern matches
c) $reg is used for regular expression pattern matches
d) All of the mentioned
View Answer

Answer: a
Explanation: If your application needs to perform queries on the content of a field that holds text you can perform exact matches on the text.

3. Which of the following operations are atomic on document level?
a) update
b) remove
c) findAndModify
d) all of the mentioned
View Answer

Answer: d
Explanation: In MongoDB, write operations, e.g. db.collection.update(), db.collection.findAndModify(), db.collection.remove(), are atomic on the level of a single document.

4. ___________ bulk indexes may be more efficient for some kinds of content and workloads in real time.
a) Synchronous
b) Asynchronous
c) Unique
d) None of the mentioned
View Answer

Answer: b
Explanation: MongoDB can support keyword searches using specific data models and multi-key indexes;

advertisement
advertisement

5. Point out the correct statement.
a) An array with a large number of elements will incur greater indexing costs on insertion
b) An array with a large number of elements will incur smaller indexing costs on updates
c) An array with a small number of elements will incur greater indexing costs on insertion
d) None of the mentioned
View Answer

Answer: a
Explanation: An array with a large number of elements, such as one with several hundred or thousands of keywords will incur greater indexing costs on insertion.

6. ________ indexes can include any field whose value is a string or an array of string elements.
a) text
b) string
c) char
d) none of the mentioned
View Answer

Answer: a
Explanation: MongoDB provides text indexes to support text search of string content in documents of a collection.

7. Which of the following is related to document that do not provide a way to weight results?
a) Stemming
b) Synonyms
c) Ranking
d) None of the mentioned
View Answer

Answer: c
Explanation: The keyword look ups described in this document do not provide a way to weight results.

8. Which of the following is related to document that provide support for synonym or related queries in the application layer?
a) Stemming
b) Synonyms
c) Ranking
d) None of the mentioned
View Answer

Answer: b
Explanation: MongoDB can support keyword searches using specific data models and multi-key indexes.

advertisement

9. Which of the following is related to the parsing of document for root?
a) Stemming
b) Synonyms
c) Ranking
d) None of the mentioned
View Answer

Answer: a
Explanation: Keyword queries in MongoDB can not parse keywords for root or related words.

10. To add structures to your document to support keyword-based queries add the keywords as ______ in the array.
a) number
b) strings
c) character
d) none of the mentioned
View Answer

Answer: b
Explanation: You can then create a multi-key index on the array and create queries that select values from the array.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

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.