<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 |
Extends
Methods
-
autoFetch(autoFetch) → {Query.<T>}
-
Switching auto fetch mode
Parameters:
Name Type Description autoFetchBoolean Using auto fetch mode or not - Inherited From:
- Source:
Returns:
- Type
- Query.<T>
-
close()
-
Closing query. No operation for query is allowed after closing.
- Inherited From:
- Source:
-
del(type, callback) → {Bulk~Batch}
-
Synonym of Query#destroy()
Parameters:
Name Type Argument Description typeString <optional>
SObject type. Required for SOQL based query object. callbackCallback.<Array.<RecordResult>> <optional>
Callback function Returns:
- Type
- Bulk~Batch
-
delete(type, callback) → {Bulk~Batch}
-
Synonym of Query#destroy()
Parameters:
Name Type Argument Description typeString <optional>
SObject type. Required for SOQL based query object. callbackCallback.<Array.<RecordResult>> <optional>
Callback function - Inherited From:
- Source:
Returns:
- Type
- Bulk~Batch
-
destroy(type, callback) → {Bulk~Batch}
-
Bulk delete queried records
Parameters:
Name Type Argument Description typeString <optional>
SObject type. Required for SOQL based query object. callbackCallback.<Array.<RecordResult>> <optional>
Callback function - Inherited From:
- Source:
Returns:
- Type
- Bulk~Batch
-
destroySoon()
-
Destroy record stream after all record submission in the queue;
- Inherited From:
- Source:
-
end() → {Query}
-
Back the context to parent query object
Returns:
- Type
- Query
-
exec(options, callback) → {Query.<T>}
-
Synonym of Query#execute()
Parameters:
Name Type Argument Description optionsObject <optional>
Query options Properties
Name Type Argument Description autoFetchBoolean <optional>
Using auto fetch mode or not maxFetchNumber <optional>
Max fetching records in auto fetch mode callbackCallback.<T> <optional>
Callback function - Inherited From:
- Source:
Returns:
- Type
- Query.<T>
-
execute()
-
If execute is called in subquery context, delegate it to parent query object
-
filter(fn) → {RecordStream}
-
Filtering incoming record from upstream, and pass to downstream
Parameters:
Name Type Description fnRecordFilterFunction Record filtering function - Inherited From:
- Source:
Returns:
- Type
- RecordStream
-
include()
-
limit(limit) → {Query.<T>}
-
Limit the returning result
Parameters:
Name Type Description limitNumber Maximum number of records the query will return. - Inherited From:
- Source:
Returns:
- Type
- Query.<T>
-
map(fn) → {RecordStream}
-
Mapping incoming record from upstream, and pass to downstream
Parameters:
Name Type Description fnRecordMapFunction Record mapping function - Inherited From:
- Source:
Returns:
- Type
- RecordStream
-
maxFetch(maxFetch) → {Query.<T>}
-
Setting maxFetch query option
Parameters:
Name Type Description maxFetchNumber 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 offsetNumber Offset number where begins returning results. - Inherited From:
- Source:
Returns:
- Type
- Query.<T>
-
offset(offset) → {Query.<T>}
-
Skip records
Parameters:
Name Type Description offsetNumber Offset number where begins returning results. - Inherited From:
- Source:
Returns:
- Type
- Query.<T>
-
pause()
-
Pause record fetch
- Inherited From:
- Source:
-
pipe()
-
Auto start query when pipe() is called.
- Inherited From:
- Source:
-
resume()
-
Resume record fetch and query execution
- Inherited From:
- Source:
-
run(options, callback) → {Query.<T>}
-
Synonym of Query#execute()
Parameters:
Name Type Argument Description optionsObject <optional>
Query options Properties
Name Type Argument Description autoFetchBoolean <optional>
Using auto fetch mode or not maxFetchNumber <optional>
Max fetching records in auto fetch mode callbackCallback.<T> <optional>
Callback function Returns:
- Type
- Query.<T>
-
scanAll(scanAll) → {Query.<T>}
-
Set flag to scan all records including deleted and archived.
Parameters:
Name Type Description scanAllBoolean 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 fieldsObject | 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>
-
send(record)
-
Output record into stream.
Parameters:
Name Type Description recordRecord Record object - Inherited From:
- Source:
-
<protected> setResponseTarget(responseTarget) → {Query.<S>}
-
Parameters:
Name Type Description responseTargetString Query response target - Inherited From:
- Source:
Returns:
- Type
- Query.<S>
-
sort(sort, dir) → {Query.<T>}
-
Set query sort with direction
Parameters:
Name Type Argument Description sortString | Object Sorting field or hash object with field name and sord direction dirString | Number <optional>
Sorting direction (ASC|DESC|1|-1) - Inherited From:
- Source:
Returns:
- Type
- Query.<T>
-
stream() → {stream.Stream}
-
Create Node.js stream instance for serializing/deserialize records
- Inherited From:
- Source:
Returns:
- Type
- stream.Stream
-
then(onFulfilled, onRejected) → {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 Argument Description onFulfilledFulfilledCallback.<T, S1> <optional>
onRejectedRejectedCallback.<S2> <optional>
- Inherited From:
- Source:
Returns:
- Type
- Promise.<(S1|S2)>
-
thenCall(callback) → {Promise.<T>}
-
Promise/A+ extension Call "then" using given node-style callback function
Parameters:
Name Type Argument Description callbackCallback.<T> <optional>
Callback function - Inherited From:
- Source:
Returns:
- Type
- Promise.<T>
-
update(mapping, type, callback) → {Bulk~Batch}
-
Bulk update queried records, using given mapping function/object
Parameters:
Name Type Argument Description mappingRecord | RecordMapFunction Mapping record or record mapping function typeString <optional>
SObject type. Required for SOQL based query object. callbackCallback.<Array.<RecordResult>> <optional>
Callback function - Inherited From:
- Source:
Returns:
- Type
- Bulk~Batch
-
where(conditions) → {Query.<T>}
-
Set query conditions to filter the result records
Parameters:
Name Type Description conditionsObject | String Conditions in JSON object (MongoDB-like), or raw SOQL WHERE clause string. - Inherited From:
- Source:
Returns:
- Type
- Query.<T>