def get_oplog_cursor_since(self, caller, ts=None):
frame = getframeinfo(currentframe().f_back)
comment = "%s:%s;%s:%i" % (caller.__name__, frame.function, frame.filename, frame.lineno)
if not ts:
ts = self.get_oplog_tail_ts()
query = {'ts': {'$gte': ts}}
logging.debug("Querying oplog on %s with query: %s" % (self.uri, query))
# http://api.mongodb.com/python/current/examples/tailable.html
return self.get_oplog_rs().find(query, cursor_type=CursorType.TAILABLE_AWAIT, oplog_replay=True).comment(comment)
评论列表
文章目录