MongoDB Questions and Answers – Pipeline Limits

This set of MongoDB Multiple Choice Questions & Answers (MCQs) focuses on “Pipeline Limits”.

1. Comparison expressions return a boolean except for ________ which returns a number.
a) $copy
b) $cmp
c) $num
d) None of the mentioned
View Answer

Answer: b
Explanation: The $cmp compares both value and type, using the specified BSON comparison order for values of different types.

2. Point out the correct statement.
a) The comparison expressions take two argument expressions and compare both value and type, using the specified Java comparison order for values of different types
b) $gte returns true if the first value is greater than the second
c) $gte returns true if the first value is greater than or equal to the second
d) All of the mentioned
View Answer

Answer: c
Explanation: In general, these expressions take an array of arguments and have the following form: { <operator>: [ <argument1>, <argument2> … ] }

3. ______ returns true if the first value is less than the second.
a) $lte
b) $lt
c) $setEquals
d) None of the mentioned
View Answer

Answer: b
Explanation:$lte returns true if the first value is less than or equal to the second.

advertisement
advertisement

4. $ne returns true if the values are not _______
a) equivalent
b) null
c) 0
d) none of the mentioned
View Answer

Answer: a
Explanation:$ne compares two values and returns false when the values are equivalent.

5. $multiply __________ numbers to return the result.
a) multiplies
b) divides
c) comapres
d) all of the mentioned
View Answer

Answer: a
Explanation:$multiply accepts any number of argument expressions.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. _______ adds numbers to return the sum, or adds numbers and a date to return a new date.
a) $addnum
b) $setadd
c) $adds
d) $add
View Answer

Answer: d
Explanation: If adding numbers and a date, treats the numbers as milliseconds.

7. _______ returns the remainder of the first number divided by the second.
a) $rem
b) $mod
c) $div
d) None of the mentioned
View Answer

Answer: b
Explanation:$divide returns the result of dividing the first number by the second.
advertisement

8. String expressions, with the exception of ________ only have a well-defined behavior for strings of ASCII characters.
a) $setcon
b) $concatenation
c) $concat
d) None of the mentioned
View Answer

Answer: c
Explanation:$concat behavior is well-defined regardless of the characters used.

9. ________ subtracts two dates to return the difference in milliseconds.
a) $rem
b) $mod
c) $div
d) $subtract
View Answer

Answer: a
Explanation: The $subtract expression has the following syntax: { $subtract: [ <expression1>, <expression2> ] }.

advertisement

Sanfoundry Global Education & Learning Series – MongoDB.

Here’s the list of Best Books in MongoDB.

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.