db8 Data Types
Data Type | Description | Ref'd by |
Wrapper APIs |
Service APIs |
---|---|---|---|---|
BatchOperation | Method and parameters for operation in batch. | batch | ||
BatchResponse | Response to batch API call. | batch | ||
CountResponse | Number of objects affected by operation. |
del merge |
del merge |
|
ErrResponse | Standard error response, containing operation success or failure flag, error code and error message. |
del delKind find get merge put putKind reserveIds |
batch del delKind find get merge put putKind reserveIds search watch |
|
FindResponse | Response to find operation. | find |
find search |
|
GetResponse | Parameters for get objects operation response. | get | get | |
IndexClause | Used for creating indexes for kind object. |
putKind |
putKind | |
IndexPropClause | Defines index property. | IndexClause | ||
NotificationResponse | Notifies caller of change in query results. | find |
find search watch |
|
PutResponse |
Indicates success of operation and returns id and rev fields for each object.
|
del merge put |
del merge put |
|
PutResult |
Contains id and rev field for JSON data object stored in put operation.
|
PutResponse | ||
Query | Defines db8 query. |
del merge find |
del merge find watch |
|
ReserveIdsResponse | Contains operation success or failure flag and array of reserved db8 IDs. | reserveIds | reserveIds | |
RevSetClause | Defines a revision set for a kind. See Using Revision Sets for more information. | putKind | ||
RevSetPropClause | Defines a property in a revision set. | RevSetClause | ||
SuccessResponse | Indicates operation success or failure. |
delKind putKind |
delKind putKind watch |
|
WhereClause | Defines SQL-like JSON where clause for query. | Query |
BatchResponse
Response to batch operation.
Schema
{ "returnValue" : boolean, "responses" : any array }
CountResponse
Number of objects affected by operation.
Schema
{ "returnValue" : boolean, "count" : int }
ErrResponse
Standard error response, containing operation success or failure flag, error code and error message.
Schema
{ "returnValue" : boolean, "errorCode" : int, "errorText" : string }
FindResponse
Response to a find objects operation.
Schema
{ "returnValue" : boolean, "results" : any, "count" : int, "next" : string }
Elements
Element | Required | Type | Description |
---|---|---|---|
returnValue | Yes | boolean |
true (success) or false (failure).
|
results | Yes | any | Array of db8 kind data objects. What is returned depends on the query and what is stored. |
count | No | int | Number of results that would have been returned if a limit had not been specified. |
next | No | string |
Key to pass as query's "page" property when retrieving next page of results.
|
GetResponse
Parameters for get objects operation response.
Schema
{ "returnValue" : boolean, "results" : any }
IndexClause
Used in the putKind
call for creating kind object indexes. Note that indexes determine the type of queries your app can make. See Queries and Indexing for more information.
Set the "incDel"
flag to true
if you want future queries to return marked as deleted objects. Objects are not completely deleted until an administrative purge operation takes place.
Schema
{ "name" : string, "props" : IndexPropClause, "incDel" : boolean }
Elements
Element | Required | Type | Description |
---|---|---|---|
name | Yes | string | Index name |
props | Yes | IndexPropClause | Array of properties to index together. |
incDel | No | boolean |
Include deleted objects flag. Default is false .
|
Example
{
"name" : "state",
"props" : [{"name": "state"}],
"incDel" : false
}
IndexPropClause
Defines index property for IndexClause
Schema
{ "name" : string, "collate" : string, "default" : any, "tokenize" : string, "type" : string }
Elements
Element | Required | Type | Description |
---|---|---|---|
name | Yes | string | Name of property being indexed. |
collate | No | string |
Indicates the string comparison routine used to order the index. Must be one of the following:
|
default | No | any | Default value to set for this property at insertion time, if not present. |
tokenize | No | string |
Indicates if words in strings should be broken up, i.e., should "Hello World" become "Hello" and "World" for purposes of indexing. Must be one of the following:
|
type | Yes | string | "single" or "multi". Single property or multiple properties. |
NotificationResponse
Notifies caller of change in query results returned from a "find" call.
Schema
{ "returnValue" : boolean, "fired" : boolean }
PutResponse
Indicates success of operation and returns id and rev fields for each object.
Schema
{ "returnValue" : boolean, "results" : PutResult }
Elements
Element | Required | Type | Description |
---|---|---|---|
returnValue | Yes | boolean |
true (success) or false (failure).
|
results | Yes | PutResult | Array of objects containing the id and rev of each object that was put. |
PutResult
Contains "id" and "rev" fields in PutResponse for JSON data object.
Schema
{ "id" : any, "rev" : any }
Query
Defines a db8 query.
Schema
{ "select" : string array, "from" : string, "where" : WhereClause array, "orderBy" : string, "desc" : boolean, "incDel" : boolean, "limit" : int, "page" : string }
Elements
Element | Required | Type | Description |
---|---|---|---|
select | No | string array | Array of property names to return. |
from | Yes | string | Name of kind to retrieve results from. |
where | No | WhereClause array | Array of clauses to test. |
orderBy | No | string | Order results on this property. |
desc | No | boolean | Return results in descending order. |
incDel | No | boolean |
Include deleted objects. Deleted objects have _del=true. Note: You can only request this if the "incDel" field was true when you created your indexes during a "putKind" operation. Otherwise, the query fails with a "no index for this query" message. |
limit | No | int | Specifies maximum number of results to return (0-500). Default is 500. |
page | No | string | Page key returned by previous query. |
Example
{
"select" : ["displayName", "state"],
"from" : "com.mystuff.contacts:1",
"where" : [{"prop":"state","op":"=","val":"CA"}],
"orderBy" : "displayName",
"desc" : true
}
ReserveIdsResponse
Contains operation success or failure flag and array of reserved db8 IDs returned from "reserveIds"
call.
Schema
{ "returnValue" : boolean, "ids" : string array }
RevSetClause
Defines a revision set—subset of an object's properties that your app can be notified about when one of the properties is modified. See Using Revision Sets for more information.
Schema
{ "name" : string, "props" : RevSetPropClause array }
Elements
Element | Required | Type | Description |
---|---|---|---|
name | Yes | string | Name of the revision set (unique to this kind). |
props | Yes | RevSetPropClause array | Array of properties to include in revision set. |
SuccessResponse
Indicates operation success or failure.
Schema
{ "name" : string, }
WhereClause
Defines a SQL-like JSON where clause for a db8 Query.
Schema
{ "prop" : string, "op" : string, "val" : any, "collate" : string }
Elements
Element | Required | Type | Description |
---|---|---|---|
prop | Yes | string | Name of property to test. |
op | Yes | string |
Test operator. Must be one of the following: "<", "<=", "=", ">=", ">", "!=", "%", "?" (less than, less than or equal, equals, greater than or equal, greater than, not equal, wildcard, and full-text) The "%" operator (aka - the prefix operator) will return all matches beginning with the value specified. |
val | Yes | any | Value to test against. |
collate | No | any | Indicates the string comparison routine used to order the results. See the collate field in the IndexPropClause data structure for more information. |
Example
{
"prop" : "state",
"op" : "=",
"val" : "CA"
}