Class: SubQuery

Query~SubQuery

(protected) new SubQuery(conn, parent, config)

SubQuery object for representing child relationship query
Parameters:
Name Type Description
conn Connection Connection object
parent Query Parent query object
config Object Sub query configuration
Source:

Extends

Members

addListener

Inherited From:
Source:

filter

Get record stream of queried records, applying the given filter function
Inherited From:
Source:

map

Get record stream of queried records applying the given mapping function
Inherited From:
Source:

stream

Create data stream of queried records. Automatically resume query if paused.
Inherited From:
Source:

Methods

autoFetch(autoFetch) → {Query.<T>}

Switching auto fetch mode
Parameters:
Name Type Description
autoFetch Boolean Using auto fetch mode or not
Inherited From:
Source:
Returns:
Type
Query.<T>

del(typeopt, callbackopt) → {Bulk~Batch}

Synonym of Query#destroy()
Parameters:
Name Type Attributes Description
type String <optional>
SObject type. Required for SOQL based query object.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Inherited From:
Source:
Returns:
Type
Bulk~Batch

delete(typeopt, callbackopt) → {Bulk~Batch}

Synonym of Query#destroy()
Parameters:
Name Type Attributes Description
type String <optional>
SObject type. Required for SOQL based query object.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Inherited From:
Source:
Returns:
Type
Bulk~Batch

destroy(typeopt, callbackopt) → {Promise.<Array.<RecordResult>>}

Bulk delete queried records
Parameters:
Name Type Attributes Description
type String <optional>
SObject type. Required for SOQL based query object.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Inherited From:
Source:
Returns:
Type
Promise.<Array.<RecordResult>>

end() → {Query}

Back the context to parent query object
Source:
Returns:
Type
Query

exec(optionsopt, callbackopt) → {Query.<T>}

Synonym of Query#execute()
Parameters:
Name Type Attributes Description
options Object <optional>
Query options
Properties
Name Type Attributes Description
autoFetch Boolean <optional>
Using auto fetch mode or not
maxFetch Number <optional>
Max fetching records in auto fetch mode
scanAll Boolean <optional>
Including deleted records for query target or not
callback Callback.<T> <optional>
Callback function
Inherited From:
Source:
Returns:
Type
Query.<T>

execute(optionsopt, callbackopt) → {Query.<T>}

Execute query and fetch records from server.
Parameters:
Name Type Attributes Description
options Object <optional>
Query options
Properties
Name Type Attributes Description
autoFetch Boolean <optional>
Using auto fetch mode or not
maxFetch Number <optional>
Max fetching records in auto fetch mode
scanAll Boolean <optional>
Including deleted records for query target or not
callback Callback.<T> <optional>
Callback function
Overrides:
Source:
Returns:
Type
Query.<T>

explain(callbackopt) → {Promise.<ExplainInfo>}

Explain plan for executing query
Parameters:
Name Type Attributes Description
callback Callback.<ExplainInfo> <optional>
Callback function
Inherited From:
Source:
Returns:
Type
Promise.<ExplainInfo>

include(childRelName, conditionsopt, fieldsopt, optionsopt) → {Query~SubQuery}

Include child relationship query
Parameters:
Name Type Attributes Description
childRelName String Child relationship name to include in query result
conditions Object | String <optional>
Conditions in JSON object (MongoDB-like), or raw SOQL WHERE clause string.
fields Object | Array.<String> | String <optional>
Fields to fetch. Format can be in JSON object (MongoDB-like), array of field names, or comma-separated field names.
options Object <optional>
Query options.
Properties
Name Type Attributes Description
limit Number <optional>
Maximum number of records the query will return.
offset Number <optional>
Offset number where begins returning results.
skip Number <optional>
Synonym of options.offset.
Overrides:
Source:
Returns:
Type
Query~SubQuery

limit(limit) → {Query.<T>}

Limit the returning result
Parameters:
Name Type Description
limit Number Maximum number of records the query will return.
Inherited From:
Source:
Returns:
Type
Query.<T>

maxFetch(maxFetch) → {Query.<T>}

Setting maxFetch query option
Parameters:
Name Type Description
maxFetch Number Max fetching records in auto fetch mode
Inherited From:
Source:
Returns:
Type
Query.<T>

offset(offset) → {Query.<T>}

Synonym of Query#skip()
Parameters:
Name Type Description
offset Number Offset number where begins returning results.
Overrides:
Source:
Returns:
Type
Query.<T>

on()

Inherited From:
Source:

run(optionsopt, callbackopt) → {Query.<T>}

Synonym of Query#execute()
Parameters:
Name Type Attributes Description
options Object <optional>
Query options
Properties
Name Type Attributes Description
autoFetch Boolean <optional>
Using auto fetch mode or not
maxFetch Number <optional>
Max fetching records in auto fetch mode
scanAll Boolean <optional>
Including deleted records for query target or not
callback Callback.<T> <optional>
Callback function
Inherited From:
Source:
Returns:
Type
Query.<T>

scanAll(scanAll) → {Query.<T>}

Set flag to scan all records including deleted and archived.
Parameters:
Name Type Description
scanAll Boolean Flag whether include deleted/archived record or not. Default is false.
Inherited From:
Source:
Returns:
Type
Query.<T>

select(fields) → {Query.<T>}

Select fields to include in the returning result
Parameters:
Name Type Description
fields Object | Array.<String> | String Fields to fetch. Format can be in JSON object (MongoDB-like), array of field names, or comma-separated field names.
Inherited From:
Source:
Returns:
Type
Query.<T>

(protected) setResponseTarget(responseTarget) → {Query.<S>}

Parameters:
Name Type Description
responseTarget String Query response target
Inherited From:
Source:
Returns:
Type
Query.<S>

sort(sort, diropt) → {Query.<T>}

Set query sort with direction
Parameters:
Name Type Attributes Description
sort String | Object Sorting field or hash object with field name and sord direction
dir String | Number <optional>
Sorting direction (ASC|DESC|1|-1)
Inherited From:
Source:
Returns:
Type
Query.<T>

then(onFulfilledopt, onRejectedopt) → {Promise.<(S1|S2)>}

Promise/A+ interface http://promises-aplus.github.io/promises-spec/ Delegate to deferred promise, return promise instance for query result
Parameters:
Name Type Attributes Description
onFulfilled FulfilledCallback.<T, S1> <optional>
onRejected RejectedCallback.<S2> <optional>
Inherited From:
Source:
Returns:
Type
Promise.<(S1|S2)>

thenCall(callbackopt) → {Query}

Promise/A+ extension Call "then" using given node-style callback function
Parameters:
Name Type Attributes Description
callback Callback.<T> <optional>
Callback function
Inherited From:
Source:
Returns:
Type
Query

toSOQL(callbackopt) → {Promise.<String>}

Return SOQL expression for the query
Parameters:
Name Type Attributes Description
callback Callback.<String> <optional>
Callback function
Inherited From:
Source:
Returns:
Type
Promise.<String>

update(mapping, typeopt, callbackopt) → {Promise.<Array.<RecordResult>>}

Bulk update queried records, using given mapping function/object
Parameters:
Name Type Attributes Description
mapping Record | RecordMapFunction Mapping record or record mapping function
type String <optional>
SObject type. Required for SOQL based query object.
callback Callback.<Array.<RecordResult>> <optional>
Callback function
Inherited From:
Source:
Returns:
Type
Promise.<Array.<RecordResult>>

where(conditions) → {Query.<T>}

Set query conditions to filter the result records
Parameters:
Name Type Description
conditions Object | String Conditions in JSON object (MongoDB-like), or raw SOQL WHERE clause string.
Inherited From:
Source:
Returns:
Type
Query.<T>