Would you like to contribute to the Titanium docs? To get started, sign up for an account on the Appcelerator Wiki and sign our CLA.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed extra returns

...

Name

Description

ModelDistinct

A Model specific node. Invokes the Distinct API on a specified model and returns the response.

Instance configuration

 

Property

Description

Required

Type

model

The name of the model of which to invoke the Distinct API.

yes

string

 

Instance parameters

 

Property

Description

Required

Type

field

The field name that must be distinct.

yes

number

 

Example

 

Code Block
linenumberstrue
languagejs
collapsetrue
"model.distinct": {
 "type": "ModelDistinct",
 "config": {
   "model": "appc.arrowdb/acl"
 },
 "parameters": [
   {
     "name": "field",
     "value": "$.params.field|0"
   },
   {
     "name": "limit",
     "value": "$.params.limit|0"
   },
   {
     "name": "skip",
     "value": "$.params.skip|0"
   },
   {
     "name": "where",
     "value": "$.params.where|0"
   },
   {
     "name": "order",
     "value": "$.params.order|0"
   },
   {
     "name": "sel",
     "value": "$.params.sel|0"
   },
   {
     "name": "unsel",
     "value": "$.params.unsel|0"
   },
   {
     "name": "page",
     "value": "$.params.page|0"
   },
   {
     "name": "per_page",
     "value": "$.params.per_page|0"
   }
 ],
 "response": {
   "context": {
     "$|0": "models"
   },
   "routes": [
     {
       "conditions": [
         {
           "key": "$.error|0",
           "exists": true
         }
       ],
       "next": "response.error"
     },
     {
       "next": "response.success"
     }
   ]
 }
}