Convert an instance of a type to another type


Let’s say I have the following types:

extendable entity type X {
  A: string
  B: int
  C: datetime

entity type Y extends X {
  D: double

entity type Z extends X {
  E: double

Can I convert
Y.fetch({include: "A,B,C"}).objs to a list of Z objects easily?


The id will be duplicated because both extend from X. Need to modify the fields.