Can I reference a type by a field other than its id?


In a transform into Child, can I create a reference to Parent by referencing a field on Parent other than its id field, such as a secondary index? ie. is there a way of legitimizing the following snippets:

@db(index=['secondaryId'], unique=['secondaryId'])
entity type Parent schema name "PARENT" {
    secondaryId: string
    children: [Child](parent)

entity type Child schema name "CHILD" {
    parent: Parent

type TransformCanonicalChildToChild mixes Child transforms CanonicalChild {
    parent: ~ expression "{secondaryId: id_from_canonical}"


Yes. We have a customer using this.

remix type MeterAsset {

  //secondary key which will be used to link source systems with MeterAsset
  meterTypeCompanyKey:          string


remix type ServicePointMeterAsset {

// changing the reference from id to meterTypeCompanyKey for non-AMI meters

secondaryKey:                   string
meterTypeCompanyKeyAsset:       MeterAsset(meterTypeCompanyKey,secondaryKey)
amiAsset:                       MeterAsset(id,secondaryKey)