import time
import pymongo
c = pymongo.MongoClient()
oplog = c.local.oplog.rs
first = next(oplog.find().sort('$natural', pymongo.DESCENDING).limit(-1))
ts = first['ts']
while True:
    cursor = oplog.find({'ts': {'$gt': ts}}, tailable=True, await_data=True)
cursor.add_option(8)
while cursor.alive:
    for doc in cursor:
        ts = doc['ts']
time.sleep(1)
Pymongo — хвостовой оплог