<abstract> new Adapter(opts)
Abstract class meant to be extended by adapters.
| Name | Type | Argument | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
<optional> |
Configuration opts. Properties
|
| Source |
|---|
| node_modules/js-data-adapter/src/index.js, line 93 |
Extends
This class extends the Component class.Members
-
debug
-
Whether to log debugging information.
DetailsType Default value Source Boolean falsenode_modules/js-data-adapter/src/index.js, line 74 -
raw
-
Whether to return a more detailed response object.
DetailsType Default value Source Boolean falsenode_modules/js-data-adapter/src/index.js, line 83
Methods
-
<static> extend(props, classProps)
-
Create a subclass of this Adapter:
Method parameters:Name Type Argument Default Description propsObject <optional>
{} Properties to add to the prototype of the subclass.
Properties
Name Type Argument Description constructorObject <optional>
Provide a custom constructor function to be used as the subclass itself.
classPropsObject <optional>
{} Static properties to add to the subclass.
Return value:Type Description Constructor Subclass of this Adapter class.
DetailsSource node_modules/js-data-adapter/src/index.js, line 1425 Example// Normally you would do: import {Adapter} from 'js-data' const JSData = require('js-data@3.0.0-beta.10') const {Adapter} = JSData console.log('Using JSData v' + JSData.version.full) // Extend the class using ES2015 class syntax. class CustomAdapterClass extends Adapter { foo () { return 'bar' } static beep () { return 'boop' } } const customAdapter = new CustomAdapterClass() console.log(customAdapter.foo()) console.log(CustomAdapterClass.beep()) // Extend the class using alternate method. const OtherAdapterClass = Adapter.extend({ foo () { return 'bar' } }, { beep () { return 'boop' } }) const otherAdapter = new OtherAdapterClass() console.log(otherAdapter.foo()) console.log(OtherAdapterClass.beep()) // Extend the class, providing a custom constructor. function AnotherAdapterClass () { Adapter.call(this) this.created_at = new Date().getTime() } Adapter.extend({ constructor: AnotherAdapterClass, foo () { return 'bar' } }, { beep () { return 'boop' } }) const anotherAdapter = new AnotherAdapterClass() console.log(anotherAdapter.created_at) console.log(anotherAdapter.foo()) console.log(AnotherAdapterClass.beep()) -
afterCount(mapper, props, opts, response)
-
Lifecycle method method called by count.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes count to wait for the Promise to resolve before continuing.
If
opts.rawistruethenresponsewill be a detailed response object, otherwiseresponsewill be the count.responsemay be modified. You can also re-assignresponseto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by count.
Method parameters:Name Type Description mapperObject The
mapperargument passed to count.propsObject The
propsargument passed to count.optsObject The
optsargument passed to count.responseObject | Response Count or Response, depending on the value of
opts.raw.DetailsSource node_modules/js-data-adapter/src/index.js, line 115 Properties:
Name Type Description opts.opString afterCount -
afterCreate(mapper, props, opts, response)
-
Lifecycle method method called by createMany.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes createMany to wait for the Promise to resolve before continuing.
If
opts.rawistruethenresponsewill be a detailed response object, otherwiseresponsewill be the created records.responsemay be modified. You can also re-assignresponseto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by createMany.
Method parameters:Name Type Description mapperObject The
mapperargument passed to createMany.propsArray.<Object> The
propsargument passed to createMany.optsObject The
optsargument passed to createMany.responseArray.<Object> | Response Created records or Response, depending on the value of
opts.raw.DetailsSource node_modules/js-data-adapter/src/index.js, line 161 Properties:
Name Type Description opts.opString afterCreateMany -
afterCreate(mapper, props, opts, response)
-
Lifecycle method method called by create.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes create to wait for the Promise to resolve before continuing.
If
opts.rawistruethenresponsewill be a detailed response object, otherwiseresponsewill be the created record.responsemay be modified. You can also re-assignresponseto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by create.
Method parameters:Name Type Description mapperObject The
mapperargument passed to create.propsObject The
propsargument passed to create.optsObject The
optsargument passed to create.responseObject | Response Created record or Response, depending on the value of
opts.raw.DetailsSource node_modules/js-data-adapter/src/index.js, line 138 Properties:
Name Type Description opts.opString afterCreate -
afterDestroy(mapper, id, opts, response)
-
Lifecycle method method called by destroy.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes destroy to wait for the Promise to resolve before continuing.
If
opts.rawistruethenresponsewill be a detailed response object, otherwiseresponsewill beundefined.responsemay be modified. You can also re-assignresponseto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by destroy.
Method parameters:Name Type Description mapperObject The
mapperargument passed to destroy.idString | Number The
idargument passed to destroy.optsObject The
optsargument passed to destroy.responseundefined | Response undefinedor Response, depending on the value ofopts.raw.DetailsSource node_modules/js-data-adapter/src/index.js, line 184 Properties:
Name Type Description opts.opString afterDestroy -
afterDestroyAll(mapper, query, opts, response)
-
Lifecycle method method called by destroyAll.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes destroyAll to wait for the Promise to resolve before continuing.
If
opts.rawistruethenresponsewill be a detailed response object, otherwiseresponsewill beundefined.responsemay be modified. You can also re-assignresponseto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by destroyAll.
Method parameters:Name Type Description mapperObject The
mapperargument passed to destroyAll.queryObject The
queryargument passed to destroyAll.optsObject The
optsargument passed to destroyAll.responseundefined | Response undefinedor Response, depending on the value ofopts.raw.DetailsSource node_modules/js-data-adapter/src/index.js, line 207 Properties:
Name Type Description opts.opString afterDestroyAll -
afterFind(mapper, id, opts, response)
-
Lifecycle method method called by find.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes find to wait for the Promise to resolve before continuing.
If
opts.rawistruethenresponsewill be a detailed response object, otherwiseresponsewill be the found record, if any.responsemay be modified. You can also re-assignresponseto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by find.
Method parameters:Name Type Description mapperObject The
mapperargument passed to find.idString | Number The
idargument passed to find.optsObject The
optsargument passed to find.responseObject | Response The found record or Response, depending on the value of
opts.raw.DetailsSource node_modules/js-data-adapter/src/index.js, line 230 Properties:
Name Type Description opts.opString afterFind -
afterFindAll(mapper, query, opts, response)
-
Lifecycle method method called by findAll.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes findAll to wait for the Promise to resolve before continuing.
If
opts.rawistruethenresponsewill be a detailed response object, otherwiseresponsewill be the found records, if any.responsemay be modified. You can also re-assignresponseto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by findAll.
Method parameters:Name Type Description mapperObject The
mapperargument passed to findAll.queryObject The
queryargument passed to findAll.optsObject The
optsargument passed to findAll.responseArray.<Object> | Response The found records or Response, depending on the value of
opts.raw.DetailsSource node_modules/js-data-adapter/src/index.js, line 253 Properties:
Name Type Description opts.opString afterFindAll -
afterSum(mapper, field, query, opts, response)
-
Lifecycle method method called by sum.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes sum to wait for the Promise to resolve before continuing.
If
opts.rawistruethenresponsewill be a detailed response object, otherwiseresponsewill be the sum.responsemay be modified. You can also re-assignresponseto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by sum.
Method parameters:Name Type Description mapperObject The
mapperargument passed to sum.fieldString The
fieldargument passed to sum.queryObject The
queryargument passed to sum.optsObject The
optsargument passed to sum.responseObject | Response Count or Response, depending on the value of
opts.raw.DetailsSource node_modules/js-data-adapter/src/index.js, line 276 Properties:
Name Type Description opts.opString afterSum -
afterUpdate(mapper, id, props, opts, response)
-
Lifecycle method method called by update.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes update to wait for the Promise to resolve before continuing.
If
opts.rawistruethenresponsewill be a detailed response object, otherwiseresponsewill be the updated record.responsemay be modified. You can also re-assignresponseto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by update.
Method parameters:Name Type Description mapperObject The
mapperargument passed to update.idString | Number The
idargument passed to update.propsObject The
propsargument passed to update.optsObject The
optsargument passed to update.responseObject | Response The updated record or Response, depending on the value of
opts.raw.DetailsSource node_modules/js-data-adapter/src/index.js, line 300 Properties:
Name Type Description opts.opString afterUpdate -
afterUpdateAll(mapper, props, query, opts, response)
-
Lifecycle method method called by updateAll.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes updateAll to wait for the Promise to resolve before continuing.
If
opts.rawistruethenresponsewill be a detailed response object, otherwiseresponsewill be the updated records, if any.responsemay be modified. You can also re-assignresponseto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by updateAll.
Method parameters:Name Type Description mapperObject The
mapperargument passed to updateAll.propsObject The
propsargument passed to updateAll.queryObject The
queryargument passed to updateAll.optsObject The
optsargument passed to updateAll.responseArray.<Object> | Response The updated records or Response, depending on the value of
opts.raw.DetailsSource node_modules/js-data-adapter/src/index.js, line 324 Properties:
Name Type Description opts.opString afterUpdateAll -
afterUpdateMany(mapper, records, opts, response)
-
Lifecycle method method called by updateMany.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes updateMany to wait for the Promise to resolve before continuing.
If
opts.rawistruethenresponsewill be a detailed response object, otherwiseresponsewill be the updated records, if any.responsemay be modified. You can also re-assignresponseto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by updateMany.
Method parameters:Name Type Description mapperObject The
mapperargument passed to updateMany.recordsArray.<Object> The
recordsargument passed to updateMany.optsObject The
optsargument passed to updateMany.responseArray.<Object> | Response The updated records or Response, depending on the value of
opts.raw.DetailsSource node_modules/js-data-adapter/src/index.js, line 348 Properties:
Name Type Description opts.opString afterUpdateMany -
beforeCount(mapper, query, opts)
-
Lifecycle method method called by count.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes count to wait for the Promise to resolve before continuing.
A thrown error or rejected Promise will bubble up and reject the Promise returned by count.
Method parameters:Name Type Description mapperObject The
mapperargument passed to count.queryObject The
queryargument passed to count.optsObject The
optsargument passed to count.DetailsSource node_modules/js-data-adapter/src/index.js, line 371 Properties:
Name Type Description opts.opString beforeCount -
beforeCreate(mapper, props, opts)
-
Lifecycle method method called by create.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes create to wait for the Promise to resolve before continuing.
propsmay be modified. You can also re-assignpropsto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by create.
Method parameters:Name Type Description mapperObject The
mapperargument passed to create.propsObject The
propsargument passed to create.optsObject The
optsargument passed to create.DetailsSource node_modules/js-data-adapter/src/index.js, line 389 Properties:
Name Type Description opts.opString beforeCreate -
beforeCreateMany(mapper, props, opts)
-
Lifecycle method method called by createMany.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes createMany to wait for the Promise to resolve before continuing.
propsmay be modified. You can also re-assignpropsto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by createMany.
Method parameters:Name Type Description mapperObject The
mapperargument passed to createMany.propsArray.<Object> The
propsargument passed to createMany.optsObject The
optsargument passed to createMany.DetailsSource node_modules/js-data-adapter/src/index.js, line 409 Properties:
Name Type Description opts.opString beforeCreateMany -
beforeDestroy(mapper, id, opts)
-
Lifecycle method method called by destroy.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes destroy to wait for the Promise to resolve before continuing.
A thrown error or rejected Promise will bubble up and reject the Promise returned by destroy.
Method parameters:Name Type Description mapperObject The
mapperargument passed to destroy.idString | Number The
idargument passed to destroy.optsObject The
optsargument passed to destroy.DetailsSource node_modules/js-data-adapter/src/index.js, line 429 Properties:
Name Type Description opts.opString beforeDestroy -
beforeDestroyAll(mapper, query, opts)
-
Lifecycle method method called by destroyAll.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes destroyAll to wait for the Promise to resolve before continuing.
A thrown error or rejected Promise will bubble up and reject the Promise returned by destroyAll.
Method parameters:Name Type Description mapperObject The
mapperargument passed to destroyAll.queryObject The
queryargument passed to destroyAll.optsObject The
optsargument passed to destroyAll.DetailsSource node_modules/js-data-adapter/src/index.js, line 447 Properties:
Name Type Description opts.opString beforeDestroyAll -
beforeFind(mapper, id, opts)
-
Lifecycle method method called by find.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes find to wait for the Promise to resolve before continuing.
A thrown error or rejected Promise will bubble up and reject the Promise returned by find.
Method parameters:Name Type Description mapperObject The
mapperargument passed to find.idString | Number The
idargument passed to find.optsObject The
optsargument passed to find.DetailsSource node_modules/js-data-adapter/src/index.js, line 465 Properties:
Name Type Description opts.opString beforeFind -
beforeFindAll(mapper, query, opts)
-
Lifecycle method method called by findAll.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes findAll to wait for the Promise to resolve before continuing.
A thrown error or rejected Promise will bubble up and reject the Promise returned by findAll.
Method parameters:Name Type Description mapperObject The
mapperargument passed to findAll.queryObject The
queryargument passed to findAll.optsObject The
optsargument passed to findAll.DetailsSource node_modules/js-data-adapter/src/index.js, line 483 Properties:
Name Type Description opts.opString beforeFindAll -
beforeSum(mapper, query, opts)
-
Lifecycle method method called by sum.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes sum to wait for the Promise to resolve before continuing.
A thrown error or rejected Promise will bubble up and reject the Promise returned by sum.
Method parameters:Name Type Description mapperObject The
mapperargument passed to sum.queryObject The
queryargument passed to sum.optsObject The
optsargument passed to sum.DetailsSource node_modules/js-data-adapter/src/index.js, line 501 Properties:
Name Type Description opts.opString beforeSum -
beforeUpdate(mapper, id, props, opts)
-
Lifecycle method method called by update.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes update to wait for the Promise to resolve before continuing.
propsmay be modified. You can also re-assignpropsto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by update.
Method parameters:Name Type Description mapperObject The
mapperargument passed to update.idString | Number The
idargument passed to update.propsObject The
propsargument passed to update.optsObject The
optsargument passed to update.DetailsSource node_modules/js-data-adapter/src/index.js, line 519 Properties:
Name Type Description opts.opString beforeUpdate -
beforeUpdateAll(mapper, props, query, opts)
-
Lifecycle method method called by updateAll.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes updateAll to wait for the Promise to resolve before continuing.
propsmay be modified. You can also re-assignpropsto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by updateAll.
Method parameters:Name Type Description mapperObject The
mapperargument passed to updateAll.propsObject The
propsargument passed to updateAll.queryObject The
queryargument passed to updateAll.optsObject The
optsargument passed to updateAll.DetailsSource node_modules/js-data-adapter/src/index.js, line 540 Properties:
Name Type Description opts.opString beforeUpdateAll -
beforeUpdateMany(mapper, props, opts)
-
Lifecycle method method called by updateMany.
Override this method to add custom behavior for this lifecycle hook.
Returning a Promise causes updateMany to wait for the Promise to resolve before continuing.
propsmay be modified. You can also re-assignpropsto another value by returning a different value or a Promise that resolves to a different value.A thrown error or rejected Promise will bubble up and reject the Promise returned by updateMany.
Method parameters:Name Type Description mapperObject The
mapperargument passed to updateMany.propsArray.<Object> The
propsargument passed to updateMany.optsObject The
optsargument passed to updateMany.DetailsSource node_modules/js-data-adapter/src/index.js, line 561 Properties:
Name Type Description opts.opString beforeUpdateMany -
count(mapper, query, opts)
-
Retrieve the number of records that match the selection query. Called by
Mapper#count.Method parameters:Name Type Argument Description mapperObject The mapper.
queryObject <optional>
Selection query.
Properties
Name Type Argument Description whereObject <optional>
Filtering criteria.
orderByString | Array <optional>
Sorting criteria.
sortString | Array <optional>
Same as
query.sort.limitNumber <optional>
Limit results.
skipNumber <optional>
Offset results.
offsetNumber <optional>
Same as
query.skip.optsObject <optional>
Configuration options.
Properties
Name Type Argument Default Description rawBoolean <optional>
false Whether to return a more detailed response object.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 581 -
create(mapper, props, opts)
-
Create a new record. Called by
Mapper#create.Method parameters:Name Type Argument Description mapperObject The mapper.
propsObject The record to be created.
optsObject <optional>
Configuration options.
Properties
Name Type Argument Default Description rawBoolean <optional>
false Whether to return a more detailed response object.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 627 -
createMany(mapper, props, opts)
-
Create multiple records in a single batch. Called by
Mapper#createMany.Method parameters:Name Type Argument Description mapperObject The mapper.
propsObject The records to be created.
optsObject <optional>
Configuration options.
Properties
Name Type Argument Default Description rawBoolean <optional>
false Whether to return a more detailed response object.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 669 -
destroy(mapper, id, opts)
-
Destroy the record with the given primary key. Called by
Mapper#destroy.Method parameters:Name Type Argument Description mapperObject The mapper.
idString | Number Primary key of the record to destroy.
optsObject <optional>
Configuration options.
Properties
Name Type Argument Default Description rawBoolean <optional>
false Whether to return a more detailed response object.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 712 -
destroyAll(mapper, query, opts)
-
Destroy the records that match the selection query. Called by
Mapper#destroyAll.Method parameters:Name Type Argument Description mapperObject the mapper.
queryObject <optional>
Selection query.
Properties
Name Type Argument Description whereObject <optional>
Filtering criteria.
orderByString | Array <optional>
Sorting criteria.
sortString | Array <optional>
Same as
query.sort.limitNumber <optional>
Limit results.
skipNumber <optional>
Offset results.
offsetNumber <optional>
Same as
query.skip.optsObject <optional>
Configuration options.
Properties
Name Type Argument Default Description rawBoolean <optional>
false Whether to return a more detailed response object.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 750 -
find(mapper, id, opts)
-
Retrieve the record with the given primary key. Called by
Mapper#find.Method parameters:Name Type Argument Description mapperObject The mapper.
idString | Number Primary key of the record to retrieve.
optsObject <optional>
Configuration options.
Properties
Name Type Argument Default Description rawBoolean <optional>
false Whether to return a more detailed response object.
withArray.<String> <optional>
[] Relations to eager load.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 835 -
findAll(mapper, query, opts)
-
Retrieve the records that match the selection query.
Method parameters:Name Type Argument Description mapperObject The mapper.
queryObject <optional>
Selection query.
Properties
Name Type Argument Description whereObject <optional>
Filtering criteria.
orderByString | Array <optional>
Sorting criteria.
sortString | Array <optional>
Same as
query.sort.limitNumber <optional>
Limit results.
skipNumber <optional>
Offset results.
offsetNumber <optional>
Same as
query.skip.optsObject <optional>
Configuration options.
Properties
Name Type Argument Default Description rawBoolean <optional>
false Whether to return a more detailed response object.
withArray.<String> <optional>
[] Relations to eager load.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 905 -
getOpt(opt, opts)
-
Resolve the value of the specified option based on the given options and this adapter's settings. Override with care.
Method parameters:Name Type Argument Description optString The name of the option.
optsObject <optional>
Configuration options.
Return value:Type Description * The value of the specified option.
DetailsSource node_modules/js-data-adapter/src/index.js, line 989 -
loadBelongsTo()
-
Load a belongsTo relationship.
Override with care.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 795 -
loadHasMany()
-
Load a hasMany relationship.
Override with care.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 1004 -
loadHasOne()
-
Load a hasOne relationship.
Override with care.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 1138 -
makeBelongsToForeignKey()
-
Return the foreignKey from the given record for the provided relationship.
Override with care.
Return value:Type Description * Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 1207 -
makeHasManyForeignKey()
-
Return the foreignKey from the given record for the provided relationship.
There may be reasons why you may want to override this method, like when the id of the parent doesn't exactly match up to the key on the child.
Override with care.
Return value:Type Description * Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 1161 -
makeHasManyForeignKeys()
-
Return the foreignKeys from the given record for the provided relationship.
Override with care.
Return value:Type Description * Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 1194 -
makeHasManyLocalKeys()
-
Return the localKeys from the given record for the provided relationship.
Override with care.
Return value:Type Description * Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 1177 -
respond(response, opts)
-
Method parameters:
Name Type Description responseObject Response object.
optsObject Configuration options. return {Object} If
opts.raw == truethen returnresponse, else returnresponse.data.DetailsSource node_modules/js-data-adapter/src/index.js, line 1270 -
sum(mapper, field, query, opts)
-
Retrieve sum of the specified field of the records that match the selection query. Called by
Mapper#sum.Method parameters:Name Type Argument Description mapperObject The mapper.
fieldString By to sum.
queryObject <optional>
Selection query.
Properties
Name Type Argument Description whereObject <optional>
Filtering criteria.
orderByString | Array <optional>
Sorting criteria.
sortString | Array <optional>
Same as
query.sort.limitNumber <optional>
Limit results.
skipNumber <optional>
Offset results.
offsetNumber <optional>
Same as
query.skip.optsObject <optional>
Configuration options.
Properties
Name Type Argument Default Description rawBoolean <optional>
false Whether to return a more detailed response object.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 1220 -
update(mapper, id, props, opts)
-
Apply the given update to the record with the specified primary key. Called by
Mapper#update.Method parameters:Name Type Argument Description mapperObject The mapper.
idString | Number The primary key of the record to be updated.
propsObject The update to apply to the record.
optsObject <optional>
Configuration options.
Properties
Name Type Argument Default Description rawBoolean <optional>
false Whether to return a more detailed response object.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 1282 -
updateAll(mapper, props, query, opts)
-
Apply the given update to all records that match the selection query. Called by
Mapper#updateAll.Method parameters:Name Type Argument Description mapperObject The mapper.
propsObject The update to apply to the selected records.
queryObject <optional>
Selection query.
Properties
Name Type Argument Description whereObject <optional>
Filtering criteria.
orderByString | Array <optional>
Sorting criteria.
sortString | Array <optional>
Same as
query.sort.limitNumber <optional>
Limit results.
skipNumber <optional>
Offset results.
offsetNumber <optional>
Same as
query.skip.optsObject <optional>
Configuration options.
Properties
Name Type Argument Default Description rawBoolean <optional>
false Whether to return a more detailed response object.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 1326 -
updateMany(mapper, records, opts)
-
Update the given records in a single batch. Called by
Mapper#updateMany.Method parameters:Name Type Argument Description mapperObject The mapper.
recordsArray.<Object> The records to update.
optsObject <optional>
Configuration options.
Properties
Name Type Argument Default Description rawBoolean <optional>
false Whether to return a more detailed response object.
Return value:Type Description Promise Unspecified DetailsSource node_modules/js-data-adapter/src/index.js, line 1378