Db.oplog.find() empty in Local DB: Part I

I noticed that the lecture instructions will have the student to start a standalone instance of mongod. Standalone instances do not have an oplog. Since we are learning replication we probably need to start a replicaset.

The command that the lecture instructions has us to run is:

mongod --dbpath allbymyselfdb

The command I ran to start a replicaset was:
mongod --dbpath allbymyselfdb --replset albymyseelf

Running that guy will set us on the right path.
Also after starting the mongo processs using mongo in a different shell, we’ll want to use this guy:

rs.initiate().

After that we can then run these:

use local
show collections
use local
db.oplog.rs.find()

This may need to be changed in the lecture so that the student isn’t confused.
Thanks!

What’s the title of the lecture that you’re referring to?

The title of the lecture was in the title of the post “Local DB: Part I”

Thanks @naeemgitonga

The point of this lecture is about the local DB. He first explains what is contained in this db when run as a standalone server, but from 1:15 he switches to a replica set and explains how this db looks in a replica set.

If the structure of your chapter is like the screenshot below, the lecture about setting up a replica set was discussed in a prior lecture. There was no need to further explain this in this lecture. In addition, you would already have a running replica set from a prior lab which you could have used to test the local db. Can you confirm if your Chapter 2 follows the same structure as mine?

Hi @naeemgitonga,

It is very explicitly mentioned in the video lecture that first you are connecting to a standalone node and seeing the list of collections available in the local database. And then you can connect to the primary of any replica set to see the content of the local database.

That being said, I will discuss it with the team and see if we can improve the instructions mentioned in the lecture notes.

Thanks,
Shubham Ranjan
Curriculum Support Engineer