In a MongoDB replica set, which node accepts write operations?
Primary
Arbiter
Any node
Secondary
During a read operation in MongoDB, if the requested data is not found in the WiredTiger cache, where is it retrieved from?
Data Files
Oplog
Config Servers
Journal Files
What is a key consideration for optimizing aggregation pipelines with large datasets in MongoDB?
Minimizing the use of indexes
Performing joins as early as possible in the pipeline
Avoiding the $match stage for optimal performance
Using JavaScript functions for complex logic
In a compound index {field1: 1, field2: -1}, what does the '-1' signify for 'field2'?
Exclude 'field2' from the index.
Mark 'field2' as a sparse field.
Ascending order sort.
Descending order sort.
What happens to a multi-document transaction in MongoDB if one of the operations within the transaction fails?
The transaction partially succeeds, applying only the successful operations.
The transaction enters a paused state, allowing the user to manually resolve the error before resuming.
The transaction continues, ignoring the failed operation and proceeding with the rest.
The entire transaction is rolled back, ensuring atomicity and data consistency.
In MongoDB aggregation, what does the $unwind stage do?
Sorts documents in ascending order
Deconstructs an array field into separate documents
Groups documents by a specific field
Merges multiple documents into one
How does creating indexes on appropriate fields impact the performance of aggregation queries in MongoDB?
Indexes are only relevant for find() queries, not aggregation
Indexes can negatively affect aggregation performance
Indexes have no impact on aggregation performance
Indexes can significantly improve aggregation performance
How can you improve the performance of a $lookup operation in MongoDB?
Use $sort after the $lookup stage
Use $match to filter documents before the $lookup stage
Avoid using $lookup altogether
Use $project to limit fields returned after the $lookup
What is the role of SSL/TLS in securing MongoDB deployments?
Encrypting communication between MongoDB clients and servers
Providing a mechanism for user authentication
Encrypting data at rest within the database files
Auditing and logging database access
What is a crucial aspect to consider regarding performance when working with transactions in MongoDB?
Transactions are only recommended for read-only operations to maintain data consistency.
Transactions always improve performance by grouping related operations.
Transactions can introduce additional overhead, so it's essential to use them judiciously where ACID properties are strictly required.
Transactions generally have no impact on performance and can be used liberally.