Skip to content

Update Constraints

CJ Brewer edited this page Oct 12, 2016 · 1 revision

KEY: "valid" = (1) record exists and (2) that record's _meta._archived is set to false.

hasMany --> hasMany

checkValidIds

  • Any new id in the original's relationship array must point to a "valid" id.

hasMany --> hasOne

NOTE: The original's relationship is not actually stored.

checkManyInverseHasOne

  • Any new id in the original's relationship array must point to a "valid" id.

  • Each new id's relationship must either be (A) or (B) or (C)

    (A) empty

    (B) a resourcePointer with its _archived flag set to true

    (C) a resourcePointer with its _related flag set to false

hasMany --> belongsTo

NOTE: The original's relationship is not actually stored.

  • Throw an error

hasOne --> hasOne

checkInverseHasOne

  • The new id in the original's relationship must point to a "valid" id.

  • The new id's relationship must either be (A) or (B) or (C)

    (A) empty

    (B) a resourcePointer with its _archived flag set to true

    (C) a resourcePointer with its _related flag set to false

hasOne --> hasMany

NOTE: The inverse's relationship is not actually stored.

checkValidId

  • The new id in the original's relationship must point to a "valid" id.

hasOne --> belongsTo

  • Throw an error

belongsTo --> hasMany

NOTE: The inverse's relationship is not actually stored.

  • Throw an error

belongsTo --> hasOne

  • Throw an error

Clone this wiki locally