To work with data stored in Telerik Platform, you need to first specify the content type that you want to work with. Having done that, you can call data methods to create, read, update, delete, and otherwise manipulate data.
Working with external data from Data Connectors follows the exact same workflow because the data is always mapped to Telerik Platform content types.
- Accessing Content Types
- Working with Undefined Content Type Fields
You need to specify a content type name to work with when accessing Backend Services data. To do that, call the
data() method of your
Everlive instance and pass the content type name to it. This method returns a new collection instance that can be queried to perform the basic CRUD operations.
var el = new Everlive('your-app-id'); var books = el.data('Books'); books.get().then( // ... );
Everlive instance has a predefined collection object for the Users content type that allows for User Management. This object has a few additional methods such as
|Date and Time||Date|
Assume that you have a content type called
Books that defines three fields in its structure:
Price. You can add the non-predefined field
Notes to a given instance of the
Books type and you will still be able to save and read this field.
var el = new Everlive('your-app-id'); var book = new Book('author', 'title', 'price'); book['Notes'] = 'A very interesting book.'; el.data('Books').updateSingle(book);
When you need to make more elaborate queries to read, update, or delete Telerik Platform data, create an instance of the
Query class. Then use its methods to specify filters, sorting, paging, and so on.
var el = new Everlive('your-app-id'); var books = el.data('Books'); var query = new Everlive.Query(); query.where().eq('Author', 'Sample Text'); books.get(query) // filter .then( // ... );