Font size
WorksheetsMongodb
Total questions: 59
Worksheet time: 33mins
MongoDB is one of the leading NoSQL databases?
False
True
MongoDB indexes use a _______ data structure.
B-tree
All of the mentioned
Hash
Map
Consider a one-to-many relationship observed between a county and the cities in that county. Which of the following are valid ways to represent this one-to-many relationship with the document model in MongoDB?
document having a field to reference the document of its county.
Embed the entities for the cities as an array of sub-documents in the corresponding county document.
Embed all the fields for a city as a subdocument in the corresponding county document.
Which of the following is not part of the first phase of the data modeling methodology?
Identifying the durability of each write operation.
Listing the write operations.
Listing the read operations.
Quantifying each of the operations in terms of latency and frequency
Identifying the relationships between the units of data.
_______ scaling adds more CPU and storage resources to increase capacity.
All of the mentioned
Horizontal
Vertical
Partition
Which of the following pattern is best for static trees that do not change?
Root
Parent
Child
None of the mentioned
The ________ References pattern stores each tree node in a document; in addition to the tree node, the document stores the id of the node’s parent.
Root
Child
None of the mentioned
Parent
What is MongoDB Data Modeling?
Unlike the structured database, where we need to determine table’s schema in advance, MongoDB is very flexible in this area.
Also, common fields in a collection can contain different types of data. This helps in easy mapping.
We know that MongoDB is a document-oriented database or NoSQL database.
MongoDB deals in collections, documents, and fields.
It is a schema-less database or we can say, it has a flexible schema / We can have documents containing different sets of fields or structures in the same collection.
The most frequent operations in a given application are
The read operations
The write operations
The read and write operations
Which of the following pattern is more straightforward to use?
Array of Ancestors
Materialized Paths
Nested Sets
None of the mentioned
Point out the wrong statement.
Decisions that affect how you model data can affect application performance and database capacity
Collections do enforce document structure
Data in MongoDB has a flexible schema
None of the mentioned
From a performance standpoint, when working with a distributed database it's important to consider...
Reading from secondaries only
Routed Queries
Latency
Which of the following is true regarding partial indexes?
Partial indexes support compound indexes.
Partial indexes can be used to reduce the number of keys in an index.
Partial indexes represent a superset of the functionality of sparse indexes.
Partial indexes don't support a uniqueness constraint.
MongoDB can provide high availability with replica sets?
False
True
______________ documents capture relationships between data by storing related data in a single document structure.
Capped
Internal
External
Embedded
Which of the following queries can use an index on the zip field?
db.addresses.find( { zip : 55555 } )
db.addresses.find()
db.addresses.find( { city : "Newark", state : "NJ" } )
Which of the following statements are true about MongoDB documents?
MongoDB documents are stored as BSON documents
MongoDB documents within a collection must have the same fields.
MongoDB documents have a flexible schema
Point out the correct statement.
In practice, the documents in a collection share a different structure
The key challenge in data modeling is balancing the needs of the application, the performance characteristics of the database engine, and the data retrieval patterns
Data in MongoDB has a flexible schema
None of the mentioned
Which one of the following scenarios is the best candidate for use of the Subset Pattern?
The working set does not fit in memory and it is difficult to scale the hardware.
The developers of the system have left and no one understands the application.
The documents are too big.
The system is running out of RAM.
The system is accessing the disk too frequently
The key consideration for the structure of your documents is the decision to embed or to use references
Can not say
TRUE
FALSE
Can be true or false
The ________ Links pattern provides a simple solution to tree storage but requires multiple queries to retrieve subtrees.
Child
Parent
All of the mentioned
Root
Field is a name-value pair in a ___.
Attribute
None of the mentioned above
Table
Document
A document is a set of ___.
Key-value pairs
None of the mentioned above
Activity pair set
Application pairs
The data model available within MongoDB allows us to represent ___.
Hierarchical relationships
None of the mentioned above
Able to handle complex structures
Both All
Point out the correct statement.
One-to-Many Relationships with embedded documents presents a data model that uses embedded documents to describe one-to-one relationships between connected data
All of the mentioned
One-to-One Relationships with embedded documents presents a data model that uses embedded documents to describe one-to-one relationships between connected data
One-to-One Relationships with document references presents a data model that uses embedded documents to describe one-to-one relationships between connected data
Which of the following statements regarding indexes are true?
The _id field is automatically indexed on all collections
Indexes can decrease write, update, and delete performance.
Indexes reduce the number of documents MongoDB needs to examine to satisfy a query.
Indexes are used to increase the speed of our queries.
Which of the following relationship uses references to describe documents between connected data?
One-to-Many Relationships with Embedded Documents
None of the mentioned
One-to-Many Relationships with Document References
One-to-One Relationships with Embedded Documents
Which one of the following scenarios is best suited for the application of the Attribute Pattern?
The system is accessing the disk too frequently.
The documents need strict validation.
The working set does not fit in memory.
Some fields share a number of characteristics, and we want to search across those fields.
The documents are large.
MongoDB stores documents in ___.
Indexes
Collections
None of the mentioned above
Store
MongoDB provides a ________ index type that supports searching for string content in a collection.
string
char
none of the mentioned
text
Failover allows a ________ member to become primary if primary is unavailable.
Hidden
ViewState
Secondary
Primary
MongoDB supports sharding through the configuration of a sharded ______
sets
shapes
clusters
all of the mentioned
A record in MongoDB is a ___.
Application
Table
Document
None of the mentioned above
When should you ever read from secondaries?
To provide reads with lower latency.
To increase performance in a write-heavy system.
When doing ad-hoc queries and analytic jobs.
Which of the following phases are included in our data modeling methodology for MongoDB?
Identify the relationships between models.
Identifying the workload of the system.
Applying schema design patterns.
The create operations in database:
is an operation which involve writing data to the database
All of them
is an operation which change data that already exists in a database
Point out the correct statement.
All of the mentioned
The query to retrieve the parent of a node is slow and complex
The query to retrieve the parent of a node is slow and straightforward
The query to retrieve the parent of a node is fast and straightforward
________ store the relationships between data by including links or references from one document to another.
References
Embedded
Capped
External
Normalized data models describe relationships using ___________ between documents.
none of the mentioned
evaluation
relativeness
references
The _________ References pattern stores each tree node in array the id(s) of the node’s children.
None of the mentioned
Child
Root
Parent
_______ divides the data set and distributes the data over multiple servers, or shards.
All of the mentioned
Sharding
Partition
Vertical
Which of the following statements are true about one-to-zillions relationships?
We must take extra care when writing queries that retrieve data on the zillions side.
The relationship representations that embed documents are not recommended.
It is a special case of the one-to-many relationship.
Which of the following are valid ways to represent a one-to-one relationship with the document model in MongoDB?
Link to a single document in another collection.
Embed the fields in the document.
Embed the fields as a sub-document in the document.
Point out the wrong statement.
Creating indexes that support queries results in greatly increased query performance
None of the mentioned
An index supports a query when the index contains all the fields scanned by the query
The query scans the index and the collection
MongoDB also supports user-defined indexes on multiple fields called ____________
candidate
composite
compound
none of the mentioned
A _______ set is a group of mongod instances that host the same data set.
replica
radii
sorted
copy
Which of the following statements are true about data modeling using MongoDB?
MongoDB will help you iterate on the schema designs of your models throughout your application's lifecycle
MongoDB is schema-less so you should not worry about designing a schema for your models.
MongoDB should only be used for unstructured datasets.
Which of the following is/are true?
Vertical scaling is generally cheaper than horizontal scaling.
Picking a good shard key is one of the most important parts of sharding.
Ordered bulk operations are faster than unordered.
NoSQL is not a ___.
Relational database
Network database
None of the mentioned above
Communication set
Which of the following pattern may provide a suitable solution for storing graphs?
Parent
Root
Child
None of the mentioned
Which other type of index is mostly closely related to text indexes?
Multi-key indexes
Compound indexes
Single-key indexes
Partial indexes
______________ documents capture relationships between data by storing related data in a single document structure.
Embedded
Internal
Capped
External
All other instances, secondaries, apply operations from the _________ so that they have the same data set.
secondary
primary
center
none of the mentioned
The data in MongoDB has a flexible schema?
False
True
Normalized data models describe relationships using ___________ between documents.
references
None of the mentioned
relativeness
evaluation
Given the following schema for the products collection: {id: ObjectId, product_name : String, product_id: String}. And the following index on the products collection: {product_id: 1}. Which of the following queries will use the given index to perform the sorting of the returned documents?
db.products.find({}).sort({ product_id: 1 })
db.products.find({ product_id: '57d7a1' }).sort({ product_id: -1 })
db.products.find({ product_name: 'Soap' }).sort({ product_id: 1 })
db.products.find({}).sort({ product_id: -1 })
db.products.find({ product_name: 'Wax' }).sort({ product_name: 1 })
The embedded data model has the following disadvantages:
We can read and update data in a single database operation.
The maximum size of a MongoDB document is 16MB, which is why care must be taken before embedding documents in other documents.
It can lead to data duplication.
Which of the following is used to avoid repetition of data in MongoDB schema?
Cursor
Collectors
References
DeReferences
Amongst which of the following is / are true about MongoDB?
MongoDB is a cross-platform database
High performance database
Document oriented database
All of the mentioned above
