···138138 return nil, err
139139 }
140140 mm := MarshalableMap(out)
141141+142142+ // HACK: if a record doesn't contain a $type, we can manually set it here based on the op's collection
143143+ if mm["$type"] == "" {
144144+ mm["$type"] = op.Collection
145145+ }
146146+141147 nc, err := r.PutRecord(context.TODO(), op.Collection+"/"+*op.Rkey, &mm)
142148 if err != nil {
143149 return nil, err