···138 return nil, err
139 }
140 mm := MarshalableMap(out)
141+142+ // HACK: if a record doesn't contain a $type, we can manually set it here based on the op's collection
143+ if mm["$type"] == "" {
144+ mm["$type"] = op.Collection
145+ }
146+147 nc, err := r.PutRecord(context.TODO(), op.Collection+"/"+*op.Rkey, &mm)
148 if err != nil {
149 return nil, err