Progress will discontinue Telerik Platform on May 10th, 2018. Learn more

Data [class]

Description

A class that provides methods for all CRUD operations to a given Backend Services data type. Covers advanced scenarios with custom headers and special server-side functionality.

Access: protected

Members

Instance members

Name Return type Description
aggregate(GroupBy, [success], [error]) A fluent API aggregation / grouping data from server. Can accept aggregationExpression or fluent chaining rules.
aggregate(GroupBy) Promise A fluent API aggregation / grouping data from server. Can accept aggregationExpression or fluent chaining rules.
applyOffline(applyOffline) Data Modifies whether the query should be applied offline, if the sdk is currenty working online.
Default is true.
Only valid when offlineStorage is enabled.
count(filter) Promise Gets the count of the data items that match the filter.
count(filter, [success], [error]) Gets the count of the items that match the filter.
create(data) Promise Creates a data item.
create(data, [success], [error]) Creates an item.
destroy(filter) Promise Deletes all data items that match a filter.
destroy(filter, [success], [error]) Deletes all items that match the filter.
destroySingle(model, [success], [error]) Deletes a single data item by ID.
destroySingle(itemId, [success], [error]) Deletes a single data item by ID.
destroySingle(item) Promise Deletes a single data item by ID.
destroySingle(itemId) Promise Deletes a single data item by ID.
expand(expandExpression) Data Sets an expand expression to be used in the data request. This allows you to retrieve complex data sets using a single query based on relations between data types.
forceCache() Data Forces the request to get the data from the cache even if the data is already expired.
Only valid when caching is enabled.
get(filter) Promise Gets all data items that match the filter. This allows you to retrieve a subset of the items based on various filtering criteria.
get(filter, [success], [error]) Gets all data items that match the filter. This allows you to retrieve a subset of the items based on various filtering criteria.
getById(id) Promise Gets a data item by ID.
getById(id, [success], [error]) Gets an item by ID.
ignoreCache() Data Does not use the cache when retrieving the data.
Only valid when caching is enabled.
isNew(model) boolean Checks if the specified data item is new or not.
maxAge(maxAgeInMinutes) Data Sets cache expiration specifically for the current query.
Only valid when caching is enabled.
rawUpdate(updateObject, id, [success], [error]) Updates an object by ID with the specified update expression.
rawUpdate(updateObject, filter) Promise Updates all objects that match a filter with the specified update expression.
rawUpdate(updateObject, filter, [success], [error]) Updates all objects that match a filter with the specified update expression.
rawUpdate(updatedObject, id) Promise Updates an object by ID with the specified update expression.
save(model, [success], [error]) Saves the provided data item. This operation will create or update the item depending on whether it is new or existing.
save(item) Promise Saves the provided data item. This operation will create or update the item depending on whether it is new or existing.
setAcl(acl, id, [success], [error]) Sets the Access Control List (ACL) of an item with a specified ID.
setAcl(acl, id) Promise Sets the Access Control List (ACL) of a specified data item.
setAcl(acl, item) Promise Sets the Access Control List (ACL) of a specified data item.
setAcl(acl, item, operationParameters, [success], [error]) Sets the Access Control List (ACL) of a specified data item.
setOwner(ownerId, id) Promise Sets the owner of the specified data item.
setOwner(ownerId, id, [success], [error]) Sets the owner of the specified data item.
setOwner(acl, item) Promise Sets the owner of the specified data item.
setOwner(acl, item, operationParameters) Sets the owner of the specified data item.
skipAuth(skipAuth) Data Modifies whether the query should try to authenticate if the security token has expired.
Default is false.
Only valid when the authentication module has an onAuthenticationRequired function.
update(updateObject, filter) Promise Updates all items that match a filter with the specified update object.
update(model, filter, [success], [error]) Updates all items that match the filter with the specified update object.
updateSingle(model, [success], [error]) Updates the provided item.
updateSingle(item) Promise Updates a single data item. This operation takes an object that specifies both the data item to be updated and the updated values.
useOffline([useOffline]) Data Modifies whether the query should be invoked on the offline storage.
withHeaders(headers) Data Sets additional non-standard HTTP headers in the current data request. See List of Request Parameters for more information.
Contact us: +1-888-365-2779
sales@telerik.com
Copyright © 2016-2017, Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved.