Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface DbJoinCondition

Defines a condition for joining related objects from another collection into Coaty objects retrieved from the local collection. The join condition is used by the findObjects method. Result objects are augmented by resolving object references to related objects and by storing them in an extra property on the result object.

Hierarchy

Index

Properties

asProperty

asProperty: string

Specifies the name of the extra property to be added to the result objects. The extra property contains the matching objects which have been joined from related objects. The extra property is an array property to support one to many relations between the localProperty and the corresponding property of the related object unless isOneToOneRelation is specified as true. In this case the extra property contains a single related object or is deleted from the result object if there is no match.

If the specified property name already exists in the result object, the existing property is overwritten.

fromCollection

fromCollection: string

Specifies the collection in the same database to perform the join with.

fromProperty

fromProperty: string

Specifies the property name of the related object from the fromCollection to perform the join with.

An equality match is performed on the fromProperty to the local property.

If a related object does not contain the fromProperty the value is ignored for matching purposes.

Optional isLocalPropertyArray

isLocalPropertyArray?: boolean

Specifies whether the value of the local property is an array whose individual elements should be matched for equality against the value of the corresponding property of the related object.

If not specified, the value of this property defaults to false.

Optional isOneToOneRelation

isOneToOneRelation?: boolean

Specifies whether the join between the localProperty and the corresponding property of the related object is a one to one relation. If true, the extra property asProperty contains a single related object; otherwise it contains an array of related objects.

If not specified, the value of this property defaults to false.

localProperty

localProperty: string

Specifies the property name of an object reference to be resolved by joining.

An equality match is performed on the localProperty to the corresponding property of the related object. If isLocalPropertyArray is specified as true, the value of the local property must be an array whose elements are matched for equality individually.

If a result object does not contain the localProperty the value is ignored for matching purposes.

Generated using TypeDoc