Changes between Version 18 and Version 19 of S3/S3REST/URLFormat
- Timestamp:
- 08/15/11 10:52:09 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
S3/S3REST/URLFormat
v18 v19 34 34 == Basic Query Format == 35 35 36 The basic query format is: '''resource'''. '''field'''{'''operator'''}='''value'''36 The basic query format is: '''resource'''.{'''foreign key'''$}'''field'''{'''operator'''}='''value(s)''' 37 37 38 * '''resource''' is the name of the resource or component (without prefix) or the name of the context 39 * '''field''' is the name of the field to be tested 38 * '''resource''' is the name of the resource or component (without prefix) 39 * '''foreign key''' is the name of the foreign key field 40 * '''field''' is the name of the field in the target table 40 41 * '''operator''' is the operator 41 * '''value ''' is the value or a comma-separated list of values to test against (a comma will be treated as OR)42 * '''value(s)''' is the value or a comma-separated list of values to test against (a comma will be treated as OR) 42 43 43 44 Supported operators: … … 55 56 ||!__ex||negative containment, not contains(value)||list types only|| 56 57 58 57 59 == Field Queries == 58 60 59 * Testing a field in the main resource 61 Field names in URL queries must be prefixed by the resource alias, followed by a "." dot, like: 62 63 Master resource: 64 60 65 {{{ 61 66 /pr/person?person.first_name__like=Miriam 62 67 }}} 63 68 64 == Component Field Queries == 69 Master resources use their table name without controller prefix as alias, whereas components can have a context-dependent alias (which must be used here). 65 70 66 * Testing a field in a component resource 71 Component: 72 67 73 {{{ 68 74 /pr/person?address.city__like=Oslo 69 75 }}} 70 76 71 == Context Queries == 77 Note that any component of the master resource can be queried, even if it is not addressed by the URL. 72 78 73 * Testing a field in a referenced resource 74 * Context must be specified like '''''context''.'''name'''={'''component'''.}'''field''' 75 * '''name''' is a name for the context (as reference for subsequent queries) 76 * '''component''' is the name of the component resource (without prefix) 77 * '''field''' is the field name of the foreign key field 79 To query a field in a referenced record, append the foreign key field name followed by a "$" sign to the resource name prefix. 78 80 79 81 {{{ 80 /pr/person? context.location=address.location_id&location.lat__gt=082 /pr/person?person.location_id$lat__lt=55.0 81 83 }}} 84 85 This required that the respective foreign key field is defined as "reference" or "list:reference" type. 82 86 83 87 == Boundary Box Queries ==