DataQuery
Constructor Summary
Public Constructor | ||
public |
constructor(arg_model: DataModel): nothing Data record class, contains one collection item attributes. |
Member Summary
Public Members | ||
public |
|
Private Members | ||
private |
_fields: *[] |
|
private |
_groupby: *[] |
|
private |
_hash: * |
|
private |
|
|
private |
|
|
private |
_model: * |
|
private |
_orderby: *[] |
|
private |
_where: {} |
|
private |
|
Method Summary
Public Methods | ||
public |
get_fields(): array Get query fields. |
|
public |
Get query limit as { offset:..., length:..., first:..., last:...}. |
|
public |
Get record model. |
|
public |
get_page(arg_page_size: integer): integer Get query limit page index. |
|
public |
Get hash string. |
|
public |
set_fields(arg_fields_names: array): nothing Set query fields. |
|
public |
set_limit(arg_offset: integer, arg_length: integer): nothing Set query limit with offset and count. |
|
public |
set_page(arg_page_size: integer, arg_page_index: integer): nothing Set query limit with page size and page index. |
|
public |
set_range(arg_first: integer, arg_last: integer): nothing Set query limit with first and last indices. |
Private Methods | ||
private |
Calculate query hash string. |
|
private |
Emit on event. |
Public Constructors
public constructor(arg_model: DataModel): nothing source
Data record class, contains one collection item attributes.
API:
->constructor(arg_model)
->get_model():DataModel - get record model.
->hash():string - get query hash string.
->set_fields(arg_fields_names:array):nothing - set query fields.
->get_fields():array - get query fields names.
->set_limit(arg_offset:integer, arg_length:integer):nothing - set query limit with offset and length.
->set_range(arg_first:integer, arg_last:integer):nothing - set query limit with first and last index.
->get_limit():object - get query limit as { offset:..., length:..., first:..., last:...}
->set_page(arg_page_size, arg_page_index):nothing - set query limit with a page index.
->get_page(arg_page_size):integer - get query page.
->set_where(arg_where:object):nothing - set query where clause.
->get_where():object - get query where clause.
->and():this
->or():this
->not():this
->field(arg_field_name):this
->lt():this
->gt():this
->lte():this
->gte():this
->equal():this
->notequal():this
->like():this
->value(arg_string):this
->set_orderby(arg_orderby:array):nothing - set query orderby clause.
->get_orderby():array - get query orderby clause.
->set_groupby(arg_groupby:array):nothing - set query groupby clause.
->get_groupby():array - get query groupby clause.
Params:
Name | Type | Attribute | Description |
arg_model | DataModel | data model: contains schema. |
Return:
nothing |
Public Members
Private Members
private _fields: *[] source
private _groupby: *[] source
private _hash: * source
private _model: * source
private _orderby: *[] source
private _where: {} source
private _where_cursor: * source
Public Methods
public get_limit(): object source
Get query limit as { offset:..., length:..., first:..., last:...}.
public get_page(arg_page_size: integer): integer source
Get query limit page index.
Params:
Name | Type | Attribute | Description |
arg_page_size | integer | query page size. |
Return:
integer |
public set_fields(arg_fields_names: array): nothing source
Set query fields.
Params:
Name | Type | Attribute | Description |
arg_fields_names | array | query fields names |
Return:
nothing |
public set_limit(arg_offset: integer, arg_length: integer): nothing source
Set query limit with offset and count.
Params:
Name | Type | Attribute | Description |
arg_offset | integer | query limit offset. |
|
arg_length | integer | query limit length. |
Return:
nothing |
public set_page(arg_page_size: integer, arg_page_index: integer): nothing source
Set query limit with page size and page index.
Params:
Name | Type | Attribute | Description |
arg_page_size | integer | query page size. |
|
arg_page_index | integer | query page index. |
Return:
nothing |
public set_range(arg_first: integer, arg_last: integer): nothing source
Set query limit with first and last indices.
Params:
Name | Type | Attribute | Description |
arg_first | integer | query limit first index. |
|
arg_last | integer | query limit last index. |
Return:
nothing |