Skip to content

deleteValue

Sezer Ekinci edited this page Sep 5, 2017 · 6 revisions

"deleteValue" can be defined in manifest under the "_q" property of any node. That defines the value of actual node on delete command. "deleteValue" will be triggered, if data is sent or if "set" option is defined (as "true") while "flatte.do" function called. Otherwise it will never work.

{
  node: {
    _q:{
      // Simple
      deleteValue: null
    }
  }
}

Available Options: "$" (Means Income Data) / ".doNothing" / JS variable types / predefined templates.

Examples

{
  tests: {
    childs: {
      testID: {
        _q: {
          ID: true
        },
        childs: {
          id: {
            _q: {
              // ID of self node or parent nodes.
              // This line is for demonstration. If "#testID/id" field is not sent, saveValue will not be triggered.
              deleteValue: "#testID"
            },
          }
          firstName: {
            _q: {
              // Income data
              deleteValue: "$"

              // Whatever data is sent, flatte will not do anything about that field. Discards sent data.
              deleteValue: ".doNothing"

              // Discard incoming data and set as defined
              deleteValue: null / true / false / "a string" / {"an":"object"} / ["an","array"]

              // Predefined
              deleteValue: ".timestamp" / ".myFunction('213')"
            },
          }
        }
      }
    }
  }
}

!Important: Predefined function is not supported to recieve incoming data for now. You can pass constants as written in brackets

Clone this wiki locally