INNER CODE UNIT · Go

func

rwynn/gtm · gtm.go:147

func (cd *ChangeDoc) docId() interface{} {
	return cd.DocKey["_id"]
}

func (cd *ChangeDoc) mapTimestamp() primitive.Timestamp {
	if cd.Timestamp.T > 0 {
		// only supported in version 4.0
		return cd.Timestamp
	} else {
		// for versions prior to 4.0 simulate a timestamp
		now := time.Now().UTC()
		return primitive.Timestamp{
			T: uint32(now.Unix()),
			I: uint32(now.Nanosecond()),
		}
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…