Home
MCQS
MongoDB MCQ Quiz Hub
MongoDB Mcq Question Set 12
Choose a topic to test your knowledge and improve your MongoDB skills
1. Which of the following returns a substring of a string?
$subs
$substring
$substr
None of the mentioned
2. . Point out the correct statement.
$substr ends at a specified index position up to a specified length
$toLower converts a string to lowercase
$gtle returns true if the first value is greater than or equal to the second
All of the mentioned
3. Which of the following accepts a single argument expression?
$toLow
$toUpper
$toEqual
None of the mentioned
4. Which of the following performs case-insensitive string comparison?
$strcasecmpequals
$strcasecmp
$strcmp
None of the mentioned
5. Point out the wrong statement.
{ $meta: “textScore” } expression is only meaningful in a pipeline that includes a $match stage with a $text query
The { $meta: “textScore” } expression is the only expression that the $sort stage accepts
$toLower only has a well-defined behavior for strings of ASCII characters
None of the mentioned
6. ______ is used for access text search metadata.
$text
$metades
$meta
All of the Mentioned
7. Which of the following accepts named parameters?
$reduce
$letnum
$let
None of the mentioned
8. ____ returns the number of elements in the array.
$number
$size
$div
None of the mentioned
9. _____ returns a value without parsing.
$string
$literal
$characters
None of the mentioned
10. db.collection.aggregate() returns a _______ and can return result sets of any size.
replica
cursor
document
$subtract
11. The _____ JavaScript engine allows multiple JavaScript operations to execute at the same time.
V8
V12
V7
None of the mentioned
12. Point out the correct statement.
The read phase takes a exclusive lock
The map-reduce operation is composed of many tasks
Prior to version 3, JavaScript code executed in a single thread
All of the mentioned
13. If the ______ field for mapReduce has the sharded value, MongoDB shards the output collection using the _id field as the shard key.
input
$in
$out
None of the mentioned
14. In MongoDB __________ mongos retrieves the results from each shard, performs a merge sort to order the results.
3.0
2.0
1.0
None of the mentioned
15. Point out the wrong statement.
If the output collection does not exist, MongoDB creates and shards the collection on the _id field
Map-reduce supports operations on sharded collections, both as an input and as an output
mongos dispatches, in parallel, a map-reduce post-processing job to every shard that owns a chunk
none of the mentioned
16. Which of the following function follows the reduce method and modifies the output?
finalize
final
max
All of the mentioned
17. ______ specifies global variables that are accessible in the map.
jsMode
scope
finalize
Min
18. MongoDB converts the JavaScript objects emitted by the map function to ________ objects.
BSON
JSON
Javascript
None of the mentioned
19. You can only use jsMode for result sets with fewer than 500,000 distinct key arguments to the mapper’s _______ function.
emit()
emitter()
emitted()
none of the mentioned
20. Which of the following mode defaults to false?
jsMode
scope
finalize
Min
21. $dayOfMonth returns the day of the month for a date as a number between _____
1 and 31
1 and 30
1 and 28
None of the mentioned
22. Point out the wrong statement.
$second returns the seconds for a date as a number between 0 and 60 (leap seconds)
$minute returns the minute for a date as a number between 0 and 59
$millis returns the milliseconds of a date as a number between 0 and 1000
All of the mentioned
23. _____ returns the day of the year for a date as a number between 1 and 366.
$dayofWeekend
$dayOfWeek
$dayOfYear
None of the mentioned
24. Which of the following returns year for particular date?
$year
$yearday
$syearofmonth
None of the mentioned
25. Point out the wrong statement.
$weekDay returns the week number for a date as a number between 0 and 53 (leap year)
$cond accepts either two expressions in an ordered list or three named parameters
$toLower only has a well-defined behavior for strings of ASCII characters
None of the mentioned
26. Which of the following returns the hour for a date as a number between 0 and 23?
$minute
$hour
$seconds
All of the Mentioned
27. ______ returns the date as a formatted string.
$toString
$dateToString
$letString
None of the mentioned
28. ___ result encompasses instances of undefined values or missing fields.
Number
String
Null
None of the mentioned
29. ______ returns either the non-null result of the first expression.
$Null
$ifNull
$ElseNull
none of the mentioned
30. ______ take as input a single expression, evaluating the expression once for each input document, and maintain their state for the group of documents.
Computer
Monitors
Accumulators
Performoner
31. $sum is an accumulator operator available only in the _______ stage.
$group
$sets
$accumulator
None of the mentioned
32. Point out the wrong statement.
$avg is an accumulator operator available only in the $group stage
$sum accumulator can be used to compute the total amount and count for each group of documents
$avg ignores numeric values
All of the Mentioned
33. Which of the following ignores non numeric values?
$order
$sum
$asc
None of the mentioned
34. When using $first in a $group stage, the $group stage should follow a _______ stage to have the input documents in a defined order.
$order
$sort
$asc
None of the mentioned
35. Which of the following returns the value that results from applying an expression to the last document?
$end
$last
$max
All of the Mentioned
36. ______ returns the highest value from the group of values in documents.
$end
$last
$max
$maximum
37. Which of the following is syntax for calculating minimum value?
{ $minimum: <int> }
{ $min: <expression>}
{ $minimum: <expression> }
None of the mentioned
38. If all documents for the $min operation have null value for the field or are missing the field, the $min operator returns ____ for the minimum value.
1
0
null
none of the mentioned
39. $addToSet returns an array of all _______ values that results from applying an expression to each document.
unique
non unique
distinct
All of the mentioned
40. ____ references the root document, i.e. the top-level document, currently being processed in the aggregation pipeline stage.
CURRENT
ROOT
PRUNE
All of the Mentioned
41. Point out the wrong statement.
Variables can hold any BSON type data
Aggregation expressions can use both user-defined and system variables
To access the value of the variable, use a string with the variable name prefixed with double dollar signs ($$)
None of the mentioned
42. Which of the operator is similar to order by clause in RDBMS?
$sort
$match
$sortby
none of the mentioned
43. Which of the following provides similar functionality to join?
$unwindelem
$unwind
$unwin
None of the mentioned
44. Point out the wrong statement.
CURRENT references the start of the field path being processed in the aggregation pipeline stage
All stages start with CURRENT the same as ROOT
DESCENDING is one of the allowed results of a $let expression
None of the mentioned
45. _____ limits the number of documents in result set.
$project
$geo
$limit
none of the mentioned
46. Which of the following is used to retrieve like SELECT clause in SQL?
$reduce
$select
$project
none of the mentioned
47. ____ groups documents by some specified expression and outputs to the next stage a document for each distinct grouping.
$setcon
$group
$match
None of the mentioned
48. ______ works similar to HAVING clause in SQL.
$setcon
$group
$match
None of the mentioned
49. COUNT function is provided by _________ in MongoDB.
$end
$sum
$max
All of the Mentioned
50. MongoDB indexes use a _______ data structure.
Hash
Map
B-tree
All of the mentioned
Submit