C100DBA practice question 2 of 25

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:

Full set: 130 questions
Answer options
A: oplog.rs
B: ..oplog.rs
C: .oplog.rs
D: local.oplog.rs Correct answer
Correct Answer:
D. local.oplog.rs
Explanation

The oplog (operations log) is a special capped collection that records all data-modifying operations. For replica sets, this collection is stored within the local database on every member. The collection itself is named oplog.rs. Therefore, the fully qualified namespace to access the oplog is local.oplog.rs. This design ensures that the oplog's operations are local to each server and are not replicated themselves, preventing an infinite replication loop.

Why Incorrect

A. oplog.rs is the name of the collection, but it omits the local database which is a required part of the namespace.
B. ..oplog.rs is an invalid namespace format in MongoDB.
C. .oplog.rs is an invalid namespace format in MongoDB.

References

1. MongoDB Manual. (n.d.). Replica Set Oplog. MongoDB Documentation. Retrieved from https://www.mongodb.com/docs/manual/core/replica-set-oplog/. In the "Oplog Collection Behavior" section, it states, "To view the contents of the oplog, switch to the local database and run db.oplog.rs.find() on a member of the replica set."

Scroll to Top