new SObject()
A class for organizing all SObject access
- Source:
Methods
-
bulkload(operation, options, input, callback) → {Bulk~Batch}
-
Call Bulk#load() to execute bulkload, returning batch object
Parameters:
Name Type Argument Description operation
String Bulk load operation ('insert', 'update', 'upsert', 'delete', or 'hardDelete') options
Object <optional>
Options for bulk loading operation Properties
Name Type Argument Description extIdField
String <optional>
External ID field name (used when upsert operation). input
Array.<Record> | stream.Stream | String <optional>
Input source for bulkload. Accepts array of records, CSv string, and CSV data input stream. callback
Callback.<Array.<RecordResult>> <optional>
Callback function - Source:
Returns:
- Type
- Bulk~Batch
-
count(conditions, callback) → {Query.<Number>}
-
Count num of records which matches given conditions
Parameters:
Name Type Argument Description conditions
Object | String <optional>
Conditions in JSON object (MongoDB-like), or raw SOQL WHERE clause string. callback
Callback.<Number> <optional>
Callback function - Source:
Returns:
- Type
- Query.<Number>
-
create(records, callback) → {Promise.<(RecordResult|Array.<RecordResult>)>}
-
Create records
Parameters:
Name Type Argument Description records
Record | Array.<Record> A record or array of records to create callback
Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<(RecordResult|Array.<RecordResult>)>
-
createBulk(input, callback) → {Bulk~Batch}
-
Bulkly insert input data using bulk API
Parameters:
Name Type Argument Description input
Array.<Record> | stream.Stream | String <optional>
Input source for bulk insert. Accepts array of records, CSv string, and CSV data input stream. callback
Callback.<Array.<RecordResult>> <optional>
Callback function - Source:
Returns:
- Type
- Bulk~Batch
-
del(ids, callback) → {Promise.<(RecordResult|Array.<RecordResult>)>}
-
Synonym of SObject#destroy()
Parameters:
Name Type Argument Description ids
String | Array.<String> A ID or array of IDs to delete callback
Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<(RecordResult|Array.<RecordResult>)>
-
delete(ids, callback) → {Promise.<(RecordResult|Array.<RecordResult>)>}
-
Synonym of SObject#destroy()
Parameters:
Name Type Argument Description ids
String | Array.<String> A ID or array of IDs to delete callback
Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<(RecordResult|Array.<RecordResult>)>
-
deleteBulk(input, callback) → {Bulk~Batch}
-
Synonym of SObject#destroyBulk()
Parameters:
Name Type Argument Description input
Array.<Record> | stream.Stream | String <optional>
Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream. callback
Callback.<Array.<RecordResult>> <optional>
Callback function - Source:
Returns:
- Type
- Bulk~Batch
-
deleted(start, end, callback) → {Promise.<DeletedRecordsInfo>}
-
Retrieve the deleted records
Parameters:
Name Type Argument Description start
String | Date start date or string representing the start of the interval end
String | Date start date or string representing the end of the interval, must be > start callback
Callback.<DeletedRecordsInfo> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<DeletedRecordsInfo>
-
deleteHardBulk(input, callback) → {Bulk~Batch}
-
Synonym of SObject#destroyHardBulk()
Parameters:
Name Type Argument Description input
Array.<Record> | stream.Stream | String <optional>
Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream. callback
Callback.<Array.<RecordResult>> <optional>
Callback function - Source:
Returns:
- Type
- Bulk~Batch
-
describe(callback) → {Promise.<DescribeSObjectResult>}
-
Describe SObject metadata
Parameters:
Name Type Argument Description callback
Callback.<DescribeSObjectResult> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<DescribeSObjectResult>
-
destroy(ids, callback) → {Promise.<(RecordResult|Array.<RecordResult>)>}
-
Delete records
Parameters:
Name Type Argument Description ids
String | Array.<String> A ID or array of IDs to delete callback
Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<(RecordResult|Array.<RecordResult>)>
-
destroyBulk(input, callback) → {Bulk~Batch}
-
Bulkly delete records specified by input data using bulk API
Parameters:
Name Type Argument Description input
Array.<Record> | stream.Stream | String <optional>
Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream. callback
Callback.<Array.<RecordResult>> <optional>
Callback function - Source:
Returns:
- Type
- Bulk~Batch
-
destroyHardBulk(input, callback) → {Bulk~Batch}
-
Bulkly hard delete records specified in input data using bulk API
Parameters:
Name Type Argument Description input
Array.<Record> | stream.Stream | String <optional>
Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream. callback
Callback.<Array.<RecordResult>> <optional>
Callback function - Source:
Returns:
- Type
- Bulk~Batch
-
find(conditions, fields, options, callback) → {Query.<Array.<Record>>}
-
Find and fetch records which matches given conditions
Parameters:
Name Type Argument Description 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 Argument 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. callback
Callback.<Array.<Record>> <optional>
Callback function - Source:
Returns:
-
findOne(conditions, fields, options, callback) → {Query.<Record>}
-
Fetch one record which matches given conditions
Parameters:
Name Type Argument Description 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 Argument 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. callback
Callback.<Record> <optional>
Callback function - Source:
Returns:
-
insert(records, callback) → {Promise.<(RecordResult|Array.<RecordResult>)>}
-
Synonym of SObject#create()
Parameters:
Name Type Argument Description records
Record | Array.<Record> A record or array of records to create callback
Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<(RecordResult|Array.<RecordResult>)>
-
insertBulk(input, callback) → {Bulk~Batch}
-
Synonym of SObject#createBulk()
Parameters:
Name Type Argument Description input
Array.<Record> | stream.Stream | String <optional>
Input source for bulk insert. Accepts array of records, CSv string, and CSV data input stream. callback
Callback.<Array.<RecordResult>> <optional>
Callback function - Source:
Returns:
- Type
- Bulk~Batch
-
record(id) → {RecordReference}
-
Get record representation instance by given id
Parameters:
Name Type Description id
String A record ID - Source:
Returns:
- Type
- RecordReference
-
retrieve(ids, callback) → {Promise.<(Record|Array.<Record>)>}
-
Retrieve specified records
Parameters:
Name Type Argument Description ids
String | Array.<String> A record ID or array of record IDs callback
Callback.<(Record|Array.<Record>)> <optional>
Callback function - Source:
Returns:
-
select(fields, callback) → {Query.<Array.<Record>>}
-
Find and fetch records only by specifying fields to fetch.
Parameters:
Name Type Argument Description 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. callback
Callback.<Array.<Record>> <optional>
Callback function - Source:
Returns:
-
update(records, callback) → {Promise.<(RecordResult|Array.<RecordResult>)>}
-
Update records
Parameters:
Name Type Argument Description records
Record | Array.<Record> A record or array of records to update callback
Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<(RecordResult|Array.<RecordResult>)>
-
updateBulk(input, callback) → {Bulk~Batch}
-
Bulkly update records by input data using bulk API
Parameters:
Name Type Argument Description input
Array.<Record> | stream.Stream | String <optional>
Input source for bulk update Accepts array of records, CSv string, and CSV data input stream. callback
Callback.<Array.<RecordResult>> <optional>
Callback function - Source:
Returns:
- Type
- Bulk~Batch
-
updated(start, end, callback) → {Promise.<UpdatedRecordsInfo>}
-
Retrieve the updated records
Parameters:
Name Type Argument Description start
String | Date start date or string representing the start of the interval end
String | Date start date or string representing the end of the interval, must be > start callback
Callback.<UpdatedRecordsInfo> <optional>
Callback function - Source:
Returns:
- Type
- Promise.<UpdatedRecordsInfo>
-
upsert(records, extIdField, callback) → {Promise.<(RecordResult|Array.<RecordResult>)>}
-
Upsert records
Parameters:
Name Type Argument Description records
Record | Array.<Record> Record or array of records to upsert extIdField
String External ID field name callback
Callback.<(RecordResult|Array.<RecordResult>)> <optional>
Callback - Source:
Returns:
- Type
- Promise.<(RecordResult|Array.<RecordResult>)>
-
upsertBulk(input, callback) → {Bulk~Batch}
-
Bulkly upsert records by input data using bulk API
Parameters:
Name Type Argument Description input
Array.<Record> | stream.Stream | String <optional>
Input source for bulk upsert. Accepts array of records, CSv string, and CSV data input stream. options.extIdField
String <optional>
External ID field name callback
Callback.<Array.<RecordResult>> <optional>
Callback function - Source:
Returns:
- Type
- Bulk~Batch