Bson Datatype(Engineering > Computer Science And Engineering > Mongodb > Gridfs ) Questions and Answers

Question 1. MongoDB represents queries as ___________ objects.
  1.    BSON
  2.    JSON
  3.    GSON
  4.    None of the mentioned
Explanation:-
Answer: Option A. -> BSON


As a client program assembles a query in MongoDB, it builds a BSON object, not a string.



Question 2. If your storage system does not support snapshots, you can copy the files directly using :
  1.    cp
  2.    copy
  3.    snap
  4.    None of the mentioned
Explanation:-
Answer: Option A. -> cp


Since copying multiple files is not an atomic operation, you must stop all writes to the mongod before copying the files.



Question 3. When you query a GridFS store for a file, the _______ will reassemble the chunks as needed.
  1.    client
  2.    server
  3.    agent
  4.    None of the mentioned
Explanation:-
Answer: Option A. -> client


You also can access information from arbitrary sections of files, which allows you to "skip into the middle of a video or audio file.



Question 4. The _______ tool reads data from a MongoDB database and creates high fidelity BSON files.
  1.    mdump
  2.    mongodump
  3.    mongod
  4.    All of the mentioned
Explanation:-
Answer: Option B. -> mongodump


mongodump is a utility for creating a binary export of the contents of a database.



Question 5. To store documents larger than the maximum size, MongoDB provides the _______ API.
  1.    Grid
  2.    MMS
  3.    GridFS
  4.    None of the mentioned
Explanation:-
Answer: Option C. -> GridFS


MongoDB preserves the order of the document fields following write operations.



Question 6. User-defined indexes on multiple fields is called :
  1.    composite index
  2.    secondary index
  3.    compound index
  4.    None of the mentioned
Explanation:-
Answer: Option C. -> compound index


The order of fields listed in a compound index has significance.



Question 7. The ________ reflect the amount of storage used, the quantity of data contained in the database, and object, collection, and index counters.
  1.    dbStats
  2.    db.serverStatus()
  3.    db.statserver()
  4.    None of the mentioned
Explanation:-
Answer: Option A. -> dbStats


The dbStats command, or db.stats() from the shell, returns a document that addresses storage use and data volumes.



Question 8. In the mongo shell, you can access the creation time of the ObjectId, using the ______ method..
  1.    getTime()
  2.    getTimestamp()
  3.    Timestamp()
  4.    None of the mentioned
Explanation:-
Answer: Option B. -> getTimestamp()


MongoDB clients should add an _id field with a unique ObjectId.



Question 9. Point out the correct statement :
  1.    The mechanics of snapshots depend on the underlying storage system
  2.    To get a consistent snapshot of a sharded system, you must disable the balancer
  3.    If your storage system does not support snapshots, you can copy the files directly using cp, rsync, or a similar tool
  4.    All of the mentioned
Explanation:-
Answer: Option D. -> All of the mentioned


Backups produced by copying the underlying data do not support point in time recovery for replica sets and are difficult to manage for larger sharded clusters.



Question 10. Point out the correct statement :
  1.    Config servers are not replica sets
  2.    Sharding requires a number of mongod instances with different configurations
  3.    The config servers store the cluster's metadata, while the cluster distributes data among one or more shard servers
  4.    None of the mentioned
Explanation:-
Answer: Option D. -> None of the mentioned


The command line and configuration file interfaces provide MongoDB administrators with a large number of options and settings for controlling the operation of the database system.