INNER CODE UNIT · Go
GetOpLogCursor
rwynn/gtm · gtm.go:978
func GetOpLogCursor(client *mongo.Client, after primitive.Timestamp, o *Options) (*mongo.Cursor, error) {
query := bson.M{
"ts": bson.M{"$gt": after},
"op": bson.M{"$in": opCodes},
"fromMigrate": bson.M{"$exists": false},
}
opts := &options.FindOptions{}
opts.SetSort(bson.M{"$natural": 1})
opts.SetCursorType(options.TailableAwait)
//opts.SetOplogReplay(true)
//opts.SetNoCursorTimeout(true)
collection := OpLogCollection(client, o)
return collection.Find(context.Background(), query, opts)
}
func opDataReady(op *Op, o *Options) (ready bool) {
if o.UpdateDataAsDelta {
ready = true