Consider that you have a collection called population which has fields state and city. Which of the following query will calculate the population grouped by state and city?
A. db.population.aggregate( [{ $group: { _id: { state: Estate", city: n$city" },pop: { $sum: "$pop" } } }] )
B. db.population.aggregate( [{ $group: { _id: { state: Estate", city: "$city" },pop: { $pop: 1 } } }] )
C. db.population.aggregate( [{ $group: { _id: { state: "$state", city; "$city" },pop: { $sum: 1 > > >] )
D. db.population.aggregate( [{ $group: { _id: { city: "$city" },pop: { $sum: "$pop" } } }] )Multi Document Transaction is not supported by MongoDB
正解:A
質問 2:
The MongoDB explain() method does not support which of the following verbosity mode:
A. customExecutionStats
B. executionStats
C. allPlansExecution
D. queryPlanner
正解:B
質問 3:
Which option can be used with update command so that a new document gets created if no matching document is found based on the query condition?
A. This has to be handled in application code (Node.js, PHP, JAVA, C#, etc.) and cannot be handled in mongo shell query
B. upsert command instead of update command
C. {update: true, insert: true} as the third parameter of update command
D. Specify {upsert : true } as the third parameter of update command
正解:D
質問 4:
You perform the following operation in the shell: db.foo.insert( { } ); What gets inserted?
A. No document will be inserted; an error will be raised
B. An empty document
C. A document with an _id assigned to be an Objectld
D. A document that matches the collection's existing schema, but with null fields
E. A document will be inserted with the same _id as the last document inserted
正解:C
質問 5:
Write the command(s) are correct to enable sharding on a database "testdb" and shard a collection "testCollection" with _id as shard key.
正解:
sh.enableSharding("testdb") & sh.shardCollection("testdb.testCollection", {_id : 1 }, true )
質問 6:
If the value of totalKeysExamined is 30000 and the value of totalDocsExamined is 0, which of the following option is correct?
A. The query returned 0 documents
B. The query returned 30000 documents after scanning the documents
C. The query used an index to fetch the results
D. None of the above
正解:C
質問 7:
What is the first task that a secondary would perform on being prompted by another secondary for an election?
A. Start the election process for primary
B. Vote for the first secondary so that it would become the next primary
C. Connect to primary to confirm its availability
D. Vote for itself and then call for election
正解:C
矢田** -
このC100DBAの情報量とみやすさのバランスが完璧です。