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

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

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

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

4. $ne returns true if the values are not _______

a) equivalent

b) null

c) 0

d) none of the mentioned

View Answer

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

5. Point out the wrong statement :

a) Boolean expressions evaluate their argument expressions as booleans and return a boolean as the result

b) Arithmetic expressions perform mathematic operations on numbers

c) Arithmetic expressions does not support date arithmetic

d) None of the mentioned

View Answer

Explanation: Some arithmetic expressions can also support date arithmetic.

6. $multiply __________ numbers to return the result.

a) multiplies

b) divides

c) comapres

d) all of the mentioned

View Answer

Explanation:$multiply accepts any number of argument expressions.

7. _______ 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

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

8. _______ returns the remainder of the first number divided by the second.

a) $rem

b) $mod

c) $div

d) None of the mentioned

View Answer

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

9. 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

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

10. ________ subtracts two dates to return the difference in milliseconds

a) $rem

b) $mod

c) $div

d) $subtract

View Answer

Explanation: The $subtract expression has the following syntax: { $subtract: [

**Sanfoundry Global Education & Learning Series – MongoDB.**

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

__Here is complete set of 1000+ Multiple Choice Questions and Answers__.