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

ModelFindAndModify

A Model specific node. Invokes the Find and Modify 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 Find and Modify API.

yes

string

 

Instance parameters

 

Property

Description

Type

Default

limit

The number of records to fetch. The value must be greater than 0, and no greater than 1000.

number

10

skip

The number of records to skip. The value must not be less than 0.

number

 

where

Constrains values for fields. The value should be encoded JSON.

string

 

order

A dictionary of one or more fields specifying sorting of results. In general, you can sort based on any predefined field that you can query using the where operator, as well as on custom fields. The value should be encoded JSON.

string

 

sel

Selects which fields to return from the query. Others are excluded. The value should be encoded JSON.

string

 

unsel

Selects which fields to not return from the query. Others are included. The value should be encoded JSON.

string

 

page

Request page number starting from 1.

number

1

per_page

Number of results per page.

number

10

Example

 

Code Block
linenumberstrue
languagejs
collapsetrue
"model.findAndModify": {
 "type": "ModelFindAndModify",
 "config": {
   "model": "appc.arrowdb/acl"
 },
 "parameters": [
   {
     "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"
   },
   {
     "name": "name",
     "value": "$.params[\"appc.arrowdb/acl\"].name|0"
   },
   {
     "name": "readers",
     "value": "$.params[\"appc.arrowdb/acl\"].readers|0"
   },
   {
     "name": "writers",
     "value": "$.params[\"appc.arrowdb/acl\"].writers|0"
   },
   {
     "name": "public_read",
     "value": "$.params[\"appc.arrowdb/acl\"].public_read|0"
   },
   {
     "name": "public_write",
     "value": "$.params[\"appc.arrowdb/acl\"].public_write|0"
   },
   {
     "name": "user",
     "value": "$.params[\"appc.arrowdb/acl\"].user|0"
   },
   {
     "name": "created_at",
     "value": "$.params[\"appc.arrowdb/acl\"].created_at|0"
   },
   {
     "name": "updated_at",
     "value": "$.params[\"appc.arrowdb/acl\"].updated_at|0"
   },
   {
     "name": "pretty_json",
     "value": "$.params[\"appc.arrowdb/acl\"].pretty_json|0"
   },
   {
     "name": "custom_fields",
     "value": "$.params[\"appc.arrowdb/acl\"].custom_fields|0"
   },
   {
     "name": "user_id",
     "value": "$.params[\"appc.arrowdb/acl\"].user_id|0"
   }
 ],
 "response": {
   "context": {},
   "routes": [
     {
       "conditions": [
         {
           "key": "$|0",
           "exists": false
         }
       ],
       "next": "response.error.notfound"
     },
     {
       "next": "response.success"
     }
   ]
 }
}