Skip to content

Commit

Permalink
parse.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tang8330 committed Oct 30, 2024
1 parent ade10cf commit aea5d34
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/cdc/mongo/debezium.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ func (s *SchemaEventPayload) GetData(pkMap map[string]any, tc kafkalib.TopicConf

if _, isOk := retMap["ts"]; !isOk {
slog.Info("ts not found in data, adding it", slog.String("table", s.GetTableName()))
objectID := retMap["_id"].(primitive.ObjectID)
objectID, err := primitive.ObjectIDFromHex(retMap["_id"].(string))
if err != nil {
panic(fmt.Sprintf("failed to parse ObjectID: %v", err))
}

retMap["ts"] = objectID.Timestamp()
}
case "r", "u", "c":
Expand Down

0 comments on commit aea5d34

Please sign in to comment.