Cuestiones
ayuda
option
Mi Daypo

TEST BORRADO, QUIZÁS LE INTERESEmongodb

COMENTARIOS ESTADÍSTICAS RÉCORDS
REALIZAR TEST
Título del test:
mongodb

Descripción:
dba mongodb

Autor:
AVATAR

Fecha de Creación:
19/10/2017

Categoría:
Otros

Número preguntas: 109
Comparte el test:
Facebook
Twitter
Whatsapp
Comparte el test:
Facebook
Twitter
Whatsapp
Últimos Comentarios
No hay ningún comentario sobre este test.
Temario:
Which of the following does MongoDB use to provide High Availability and fault tolerance? Write Concern Replication Sharding Indexing.
Which of the following does MongoDB use to provide High Scalability? Write Concern Replication Sharding Indexing.
Below is a sample document in a given collection test. { a : 5, b : 3, c: 2, d : 1 } Given a compound index { a: 1, b:1, c:1, d:1}, Which of the below query will not use in-memory sorting? Select all valid. db.test.find( { a: 5, b: 3 } ).sort( { a: 1, b: 1, c: 1 } ) db.test.find( { a: 5, b: 3 } ).sort( { a: 1} ) db.test.find( { a: 5, b: 3 } ).sort( {c: 1 } ) db.test.find( { a: 5, b: 3 } ).sort( { c: 1, d : 1 } ).
Which of the following is true about aggregation framework? A single aggregation framework operator can be used more than once in a query Each aggregation operator need to return atleast one of more documents as a result Pipeline expressions are stateless except accumulator expressions used with $group operator the aggregate command operates on a multiple collection.
In a replicated cluster, which of the following node would only be used during an election? primary secondary arbiter hidden.
What is the first task that a secondary would perform on being prompted by another secondary for an election? Start the election process for primary Connect to primary to confirm its availability Vote for the first secondary so that it would become the next primary Vote for itself and then call for election.
In which of the following scenarios is sharding not the correct option. Select all that apply. The working set in the collection is expected to grow very large in size The write operations on the collection are low The collection is a read intensive collection with less working set The write operations on the collection are very high.
Which of the following collections stores authentication credentials in MongoDB? system.users local.users test.users users.users.
In a sharded cluster, from which node does one stop the balancer process before initiating backup? Any node mongos node config server node replicaset primary node.
Which of the following are valid json documents? Select all that apply. {“name”:”Fred Flintstone”;”occupation”:”Miner”;”wife”:”Wilma”} {} {“city”:”New York”, “population”, 7999034, boros:{“queens”, “manhattan”, “staten island”, “the bronx”, “brooklyn”}} {“a”:1, “b”:{“b”:1, “c”:”foo”, “d”:”bar”, “e”:[1,2,4]}}.
Which of the following operators is used to updated a document partially? $update $set $project $modify.
Below is a sample document of “orders” collection { cust_id: “abc123”, ord_date: ISODate(“2012-11-02T17:04:11.102Z”), status: ‘A’, price: 50, items: [ { sku: “xxx”, qty: 25, price: 1 }, { sku: “yyy”, qty: 25, price: 1 } ] } Select operators for the below query to determine the sum of “qty” fields associated with the orders for each “cust_id”. db.orders.aggregate( [ { $OPR1: “$items” }, { $OPR2: { _id: “$cust_id”, qty: { $OPR3: “$items.qty” } } } ] ) OPR1 is $group $project $unwind $sum.
Below is a sample document of “orders” collection { cust_id: “abc123”, ord_date: ISODate(“2012-11-02T17:04:11.102Z”), status: ‘A’, price: 50, items: [ { sku: “xxx”, qty: 25, price: 1 }, { sku: “yyy”, qty: 25, price: 1 } ] } Select operators for the below query to determine the sum of “qty” fields associated with the orders for each “cust_id”. db.orders.aggregate( [ { $OPR1: “$items” }, { $OPR2: { _id: “$cust_id”, qty: { $OPR3: “$items.qty” } } } ] ) OPR2 is $group $sort $limit $sum.
Below is a sample document of “orders” collection { cust_id: “abc123”, ord_date: ISODate(“2012-11-02T17:04:11.102Z”), status: ‘A’, price: 50, items: [ { sku: “xxx”, qty: 25, price: 1 }, { sku: “yyy”, qty: 25, price: 1 } ] } Select operators for the below query to determine the sum of “qty” fields associated with the orders for each “cust_id”. db.orders.aggregate( [ { $OPR1: “$items” }, { $OPR2: { _id: “$cust_id”, qty: { $OPR3: “$items.qty” } } } ] ) OPR3 is $match $project $skip $sum.
Which of the following index would be optimum for the query? Select all valid. db.test.find( { a : 5, c : 2 }) db.test.ensureIndex( { a: 1, b :1, c:1, d:1}) db.test.ensureIndex( { a : 1, c: 1, d: 1, b : 1}) db.test.ensureIndex( { a :1, c:1}) db.test.ensureIndex( { c:1, a: 1}).
What is the replication factor for a replicated cluster with 1 primary, 3 secondaries with one of them hidden. The set also has an arbiter? 3 4 5 None of the above.
Write the command(s) are correct to enable sharding on a database “testdb” and shard a collection “testCollection” with _id as shard key.
To add a new user and enable authentication in MongoDB, which of the following steps need be executed? update users collection and restart mongodb update users collection and restart mongodb with –auth option update users collection and run db.enableAuthentication() All of the above.
Which of the following needs to be performed prior to initiate backup on a sharded cluster? db.stopServer() db.stopBalancer() sh.stopServer() sh.stopBalancer().
What is the use of mongodump and mongorestore tools? replicate mongodb deployments performance tune mongodb deployment backup mongodb deployment audit mongodb deployment.
In what format does mongodump creates backup files? XML JSON BSON SOAP.
Which mongodb tool is used to report details on number of database operations in MongoDB? mongodump mongostat mongorestore mongotop.
Which command is used to determine storage capacity of specific database? mongotop mongostat dbstats collstats.
Mongodb does provide high availability via which option? Sharding Replication Indexing Journaling.
What is the on-premise solution having functionality equivalent to cloud manager? Journaling Ops Manager Service Manager Replica Manager.
Which mongodb tools allow us to work with our data in a human readable format? mongodump mongostat mongoexport mongoimport.
Which of the following node is used during election in a replication cluster? hidden arbiter primary secondary.
Which node in a replica set does accept write operation? primary arbiter secondary hidden.
You are in a sharded cluster. What will you do prior to initiating backup in sharded cluster? db.stopserver() sh.stopserver() db.stopBalancer() sh.stopBalancer().
You have a replicated cluster with 1 primary, 3 secondary, 1 arbiter. One of the secondary is hidden. What is the replication factor of this replicated cluster? 6 7 4 3.
In mongodb how do you update a document partially? $project $update $set $modify.
Which operations add new documents to a collection? Create insert update delete.
You have designed a web application with mongoDB. You have configured replication. The replica set is in place and function properly. What happens in case of failure? Failover happens automatically Failover needs to be done manually Switchover happens automatically Switchover needs to be done manually.
Which mongodb tool is used to report details on number of database operations in MongoDB? mongodump mongorestore mongostat mongotop.
Which mongodb tools allow us to work with our data in a human readable format? mongodump mongostat mongoexport mongoimport.
What is the on-premise solution having functionality equivalent to cloud manager? Journaling Ops Manager Service Manager Replica Manager.
You are comparing values of different BSON types in mongodb. You want to compare from lowest to highest. Which comparison order is used? MinKey, Null, Numbers,Symbol, String,Object,Array,BinData MinKey, Null, Numbers,Object,Array,BinData,Symbol, String Object,Array,BinData,Symbol, String,MinKey, Null, Numbers Object,Array,BinData,Symbol,MinKey, Null, Numbers,String.
Consider a collection posts which has fields: _id, post_text, post_author, post_timestamp, post_tags etc. Which of the following query retrieves ONLY the key named post_text from the first document retrieved? db.posts.find({},{_id:0, post_text:1}) db.posts.findOne({post_text:1}) db.posts.finOne({},{post_text:1}) db.posts.finOne({},{_id:0, post_text:1}).
What is the maximum size of a MongoDB document? 2 MB 16 MB 12 MB There is no maximum size. It depends on the RAM.
Consider that our posts collection contains an array field called tags that contains tags that the user enters. { _id: 1, tags: [�tutorial�, �fun�, �learning�], post_text: �This is my first post�, //other elements of document } Which of the following commands will find all the posts that have been tagged as tutorial. db.posts.find( { tags : "tutorial" } ); db.posts.find( { tags : ["tutorial"] } ); db.posts.find( { $array : {tags: "tutorial"} } ); db.posts.findInArray( { tags : "tutorial" } );.
Which option should be used to update all the documents with the specified condition in the MongoDB query? updateAll instead of update specify {multi : true} as the third parameter of update command specify {all: true} as the third parameter of update command specify {updateAll: true} as the third parameter of update command.
Consider the following posts document: { _id: 1, post_text: �This is my first post�, author: �Tom�, tags: [�tutorial�,�quiz�,�facebook�,�learning�,�fun�] } Which of the following queries will return the documents but with only the first two tags in the tags array? db.posts.find({author:"Tom"},{tags:{$slice:2}}) db.posts.find({author:"Tom"}).limit({tags:2}) db.posts.find({author:"Tom"}).limit($slice:{tags:2}) Both "db.posts.find({author:"Tom"},{tags:{$slice:2}})" and "db.posts.find({author:"Tom"}).limit($slice:{tags:2})" are valid. $slice works both with projection and limit.
Aggregation Pipelines have a limit of: 2 MB document and 100 MB RAM 16 MB document and 100 MB RAM 2 MB document and no limit on RAM No limit on document and 100 MB RAM.
The following aggregation option is used to specify the specific fields that needs to be passed to the next stage of the aggregation pipeline: $match $project $group $aggregate.
Given a collection posts as shown below having a document array comments, which of the following command will create an index on the comment author descending? { �_id�:1, �post_text�:�This is a sample post�, �author�:�Tom�, �comments�:[ { �author�:�Joe�, �comment_text�:�This is comment 1� }, { �author�:�Leo�, �comment_text�:�This is comment 2� } ] } db.posts.createIndex({�comments.$.author":-1}); db.posts.createIndex({�comments.author":-1}); db.posts.createIndex({�comments.author":1}); db.posts.createIndex({�comments.$.author": {�$desc�:1}}); .
Which of the tags in a replica set configuration specify the operations to be read from the node with the least network latency? primaryPreferred secondaryPreferred nearest netLatency.
Consider the following document from the products collection: { _id: 1, product_code: "345678", variations: [ { size: "L", price: 1000 }, { size: "M", price: 800 } ] } What does the following query using $elemMatch return? db.products.find( { product_code: "345678" }, { variations: { $elemMatch: { size: �L� } } } ) Returns the complete document since MongoDB does not support partial array retrieval Returns the document but with only one element in the variations array (corresponding to size L) Returns the complete document but retrieves only the size field from the array Returns the complete document but retrieves only the size field from the array and also with only one element in the variations array (corresponding to size L).
MongoDB is Object-oriented DBMS Document-oriented DBMS Relational DBMS None of the above.
MongoDB is a schema-less design. True False.
JSON stands for JavaScript Object Naming JavaScript Object Notice JavaScript Object Notation None of the above.
‘mongoimport’ command is used for Batch data insertion Multiple command import Multiple command insertion None of the above.
‘$set’ sets the value of Key Code block Name/value pair None of the above.
Which of the following about Capped Collections is correct? Fixed Size If the allocated space for a capped collection exceeds, it stops inserting new documents High-throughput operations that insert and retrieve documents based on insertion order Only "Fixed Size" and "High-throughput operations that insert and retrieve documents based on insertion order ".
Which is the correct order (lowest to highest) in which MongoDB compares the BSON types? Null, Number, String and Object Number, Null, String and Object String, Null, Number and Object Null, Number, Object and String.
Which of the following command inside aggregate command is used in MongoDB aggregation to filter the documents to pass only the documents that match the specified condition(s) to the next pipeline stage. $group $match $aggregate $sum.
Which of the following is supported by MongoDB? ACID Transactions Relationships between Collections (Primary Key Foreign Key) Journaling Transaction Management.
What is the output of the following program? 60 s 100 ms 1 s 100 s.
What does the following query do when performed on the posts collection? db.posts.update({_id:1},{Title:This is post with ID 1"}) Updates the Title of the post Updating a document is possible only with $set Replaces the complete document with _id as 1 with the document specified in second parameter Syntax error.
The difference between $push and $addToSet is: $addToSet adds the item to the field only if the new item is of the same datatype $addToSet needs the fields to be already present while $push will work even if the field is not present $addToSet adds the item to the field only if it does not exist already; while $push pushes the item to the field irrespective of whether it was present or not There is no major difference between them. $addToSet is a deprecated version of $push.
A collection and a document in MongoDB is equivalent to which of the SQL concepts respectively? Table and Row Table and Column Column and Row Database and Table .
What does the following aggregate query perform? db.posts.aggregate( [ { $match : { likes : { $gt : 100, $lte : 200 } } }, { $group: { _id: null, count: { $sum: 1 } } } ] ); Calculates the number of posts with likes between 100 and 200 Groups the posts by number of likes (101, 102, 103.) by adding 1 every time Fetches the posts with likes between 100 and 200 and sets their _id as null Fetches the posts with likes between 100 and 200, sets the _id of the first document as null and then increments it 1 every time.
Which of the following commands finds all the documents in the posts collection with post timestamp field as null? db.posts.find( { post_timestamp : { $type: 10 } } ) db.posts.find( { post_timestamp: { $type: null } } ) db.posts.find( { post_timestamp: { $fieldtype: 10 } } ) db.posts.find( { post_timestamp: { $fieldtype: null } } ).
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? db.population.aggregate( [{ $group: { _id: { state: "$state", city: "$city" },pop: { $sum: "$pop" } } }] ) db.population.aggregate( [{ $group: { _id: { state: "$state", city: "$city" },pop: { $sum: 1 } } }] ) db.population.aggregate( [{ $group: { _id: { state: "$state", city: "$city" },pop: { $pop: 1 } } }] ) db.population.aggregate( [{ $group: { _id: { city: "$city" },pop: { $sum: "$pop" } } }] )Multi Document Transaction is not supported by MongoDB.
In a replica set, a ________ number of members ensures that the replica set is always able to select a primary. Odd Even Depends on the application architecture 2.
Which are the ONLY ways to project portions of an array? $elemMatch $slice $ All of the above.
When should we consider representing a one-to-many relationship in an embedded collection instead of separate collection? When the many is very large When the many is not very large Never Always.
Which of the following commands can cause the database to be locked? Issuing a query Inserting data Map-reduce All of the above.
In a collection that contains 100 post documents, what does the following command do? db.posts.find().skip(5).limit(5) Skip and limit nullify each other. Hence returning the first five documents. Skips the first five documents and returns the sixth document five times Skips the first five documents and returns the next five Limits the first five documents and then return them in reverse order.
Which type of indexes does MongoDB support? Compound Indexes Multikey Indexes Geospatial Indexes All of the above.
We can insert multiple documents in bulk using which of the following operations: initializeUnorderedBulkOp initializeBulkOp initializeBulk initializeUnorderedBulk.
The _______ operator can be used to identify an element in the array to be updated without explicitly specifying the position of the element. $ $elemMatch $slice Updating an array field without knowing its index is not possible.
Which of the following is correct about MongoDB? MongoDB uses JSON format to represent documents MongoDB supports collection joins MongoDB supports some of the SQL functions MongoDB supports geospatial indexes.
Which is the default mode in which the explain() command runs? queryPlanner executionStats allPlansExecution customExecutionStats.
What is the equivalent command in MongoDB for the following SQL query? SELECT * FROM posts WHERE author like "%john%" db.posts.find( { author: /john/ } ) db.posts.find( { author: {$like: /john/} } ) db.posts.find( { $like: {author: /john/} } ) db.posts.find( { author: /^john^/ } ).
What does the following $slice query return using the following command? db.posts.find( {}, { comments: { $slice: [ -10, 5 ] } } ) Returns 5 comments, beginning with the last 10 items Returns 10 comments, beginning with the first Returns 10 comments, beginning with the last Returns 5 comments, beginning with the first 10 items.
In a collection that contains 100 post documents, what does the following command do? db.posts.find().skip(5).limit(5) Skip and limit nullify each other. Hence returning the first five documents Skips the first five documents and returns the sixth document five times Skips the first five documents and returns the next five Limits the first five documents and then return them in reverse order.
What is the maximum size of Index Key Limit and Number of Indexes per collection? 64 bytes and 1024 indexes 12 mega bytes and 64 indexes 1024 bytes and 64 indexes 1024 bytes and unlimited indexes.
Which of the following command is used to get all the indexes on a collection? db.collection.getIndexes() db.collection.showIndexes() db.collection.findIndexes() db.showIndexes().
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? db.population.aggregate( [{ $group: { _id: { state: "$state", city: "$city" },pop: { $sum: "$pop" } } }] ) db.population.aggregate( [{ $group: { _id: { state: "$state", city: "$city" },pop: { $sum: 1 } } }] ) db.population.aggregate( [{ $group: { _id: { state: "$state", city: "$city" },pop: { $pop: 1 } } }] ) db.population.aggregate( [{ $group: { _id: { city: "$city" },pop: { $sum: "$pop" } } }] )Multi Document Transaction is not supported by MongoDB.
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? Specify {upsert : true } as the third parameter of update command upsert command instead of update command {update: true, insert: true} as the third parameter of update command This has to be handled in application code (Node.js, PHP, JAVA, C#, etc.) and cannot be handled in mongo shell query.
Aggregation Pipelines have a limit of: 2 MB document and 100 MB RAM 16 MB document and 100 MB RAM 2 MB document and no limit on RAM No limit on document and 100 MB RAM.
What is the default size of a GridFS chunk? 16 MB 255 K 1 MB 2 MB.
The oplog (operations log) is a special capped collection that keeps a rolling record of all operations that modify the data stored in your databases. All the replica set members contain a copy of the oplog in the following collection: oplog.rs local.oplog.rs <database>..oplog.rs <replicasetid>.oplog.rs .
What is the maximum size of a MongoDB document 2 MB 16 MB 12 MB There is no maximum size. It depends on the RAM.
Which of the following aggregation commands in MongoDB does not support sharded collections? aggregate mapReduce group All of the above.
Consider that the posts collection contains an array called ratings which contains ratings given to the post by various users in the following format: { _id: 1, post_text: This is my first post, ratings: [5, 4, 2, 5], //other elements of document } Which of the following query will return all the documents where the ratings array contains elements that in some combination satisfy the query conditions? db.inventory.find( { ratings: { $elemMatch: { $gt: 3, $lt: 6 } db.inventory.find( { ratings: { ratings: { $gt: 5, $lt: 9 } } } ) db.inventory.find( { ratings: { ratings.$: { $gt: 5, $lt: 9 } } } ) db.inventory.find( { ratings: { $elemMatch: { $gte: 3, $lte: 6 } } } ).
In a sharded replica set environment, the w Option provides ability for write concern and j Option provides ability for the data to be written on disk journal. Consider that we have a seven member replica set and we want to assure that the writes are committed to journal. What should be the value of j? 0 1 2 7.
As per the aggregation pipeline optimization concepts, if you have a $sort followed by a $match: $match moves before $sort $sort moves before $match MongoDB does not do any movements by default and will use the order provided Providing these parameters in any order does not impact the performance.
By default, the MongoDB cursor in mongo shell is configured to return how many documents? To get the next set of documents, which command is used? 20, it 200, more 50, it No limit, none.
If the value of totalKeysExamined is 30000 and the value of totalDocsExamined is 0, which of the following option is correct? The query used an index to fetch the results The query returned 30000 documents after scanning the documents The query returned 0 documents None of the above.
The oplog (operations log) is a special capped collection that keeps a rolling record of all operations that modify the data stored in your databases. All the replica set members contain a copy of the oplog in the following collection: oplog.rs local.oplog.rs <database>..oplog.rs <replicasetid>.oplog.rs.
Which of the following commands will return all the posts with number of likes greater than 100 and less than 200, both inclusive? db.posts.find({ likes : { $gt : 100, $lt : 200 } } ); db.posts.find({ likes : { $gte : 100, $lt : 200 } } ); db.posts.find({ likes : { $gt : 100 , $lte : 200 } } ); db.posts.find({ likes : { $gte : 100 , $lte : 200 } } );.
Which of the following operator can be used to control the number of items of an array that a query returns? $ $elemMatch $slice MongoDB does not support partial retrieval of items from an array.
Which of the following is true about sharding? Sharding is enabled at the database level Creating a sharded key automatically creates an index on the collection using that key We cannot change a shard key directly/automatically once it is set up A sharded environment does not support sorting functionality since the documents lie on various mongod instances.
Which of the following operator can be used to limit the number of documents in an array field of a document after an update is performed? $push along with $each, $sort and $slice $removeFromSet $arrayLimit None of the above.
Update If Correct is an approach for which of the following concepts in MongoDB: Concurrency Control Transaction Management Atomicity Performance Management.
Given a collection posts as shown below having a document array comments, which of the following command will create an index on the comment author descending? { _id:1, post_text:This is a sample post, author:Tom, comments:[ { author:Joe, comment_text:This is comment 1 }, { author:Leo, comment_text:This is comment 2 } ] } db.posts.createIndex({comments.$.author":-1}); db.posts.createIndex({comments.author":-1}); db.posts.createIndex({comments.author":1}); db.posts.createIndex({comments.$.author": {$desc:1}}); .
Which command can be used to rebuild the indexes on a collection in MongoDB? db.collection.createIndex({reIndex:1}) db.collection.createIndex({author:1}).reIndex() db.collection.reIndex() db.collection.reIndex({author:1}).
Which format/standard is used by MongoDB internally to store documents? BSON JSON JSON - Extended B+ Trees.
What does the totalKeysExamined field returned by the explain method indicate? Number of documents that match the query condition Number of index entries scanned Number of documents scanned Details the completed execution of the winning plan as a tree of stages.
What is the output of following two commands in MongoDB: db.posts.insert({"_id":1}) db.posts.insert({"_id":1}) Two documents will be inserted with _id as 1 MongoDB will automatically increment the _id of the second document as 2 This will throw a duplicate key error It will insert two documents and throw a warning to the user.
The MongoDB explain() method does not support which of the following verbosity mode: queryPlanner executionStats allPlansExecution customExecutionStats.
What does the output x of the following MongoDB aggregation query result into: db.posts.aggregate( [ { $group: { _id: "$author", x: { $sum: $likes } } } ] ) Average of likes on all the posts of an author, grouped by author Number of posts by an author Sum of likes on all the posts by an author, grouped by author Sum of likes on all the posts by all the authors.
In a sharded replica set environment, the w Option provides ability for write concern and j Option provides ability for the data to be written on disk journal. Consider that we have a seven member replica set and we want to assure that the writes are committed to journal. What should be the value of j? 0 1 2 7.
Which of the following aggregate commands in MongoDB uses a pipeline approach with the goals of improving the aggregation performance? aggregate mapReduce group All of the above.
Which of the following is incorrect statement about find and findOne operations in MongoDB? find() returns all the documents in a collection while findOne() retrieves only the first one. find() and findOne() returns cursors to the collection documents findOne() returns the actual first document retrieved from a collection find.limit(1) is not the same query as findOne().
If you have created a compound index on (A,B, C) which of the following access pattern will not be able to utilize the index? A, B, C A, B B, C A.
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? Specify {upsert : true } as the third parameter of update command upsert command instead of update command {update: true, insert: true} as the third parameter of update command This has to be handled in application code (Node.js, PHP, JAVA, C#, etc.) and cannot be handled in mongo shell query.
In a sharded replicas set environment with multiple mongos servers, which of the following would decide the mongos failover? mongo shell mongod individual language drivers mongos.
Denunciar test Consentimiento Condiciones de uso