Message:

Subscribe rss
Blog categories

When a user registers or update his account, application uses the user registration API. It is common for the user interface to enforce the data entry rules and validate the values entered by the user. However, an alternative approach is to perform data validation on the server. Backendless supports user properties validation on creating and updating user objects using regular expressions. Backendless console includes several pre-configured regular expressions for the most common data types, such as email address, URL, social security number and US phone number. Additionally, app developer can specify their own regex. To configure a validator for a user property:

Continue reading

In my previous posts I described how a data object may have a related geopoint (or a collection of). One of the benefits of the data-to-geo relationships is search by distance. That means Backendless can search for data objects using the location of the related geopoints. Consider an example from a taxi-reservation system. There may be several cabs-for-hire in the area. Your app needs to locate all available cars within the specified distance from where the customer is located.

The class representing a cab may look like this:

Continue reading

Previously I wrote how to upload files to the Backendless Hosting system. Once a file is uploaded, it gets a public URL which can either be obtained using Backendless console or calculated using the following template:


Alternatively, when a file is uploaded, the API call returns the URL of the uploaded file. The sample code below demonstrates how to download the file. The code prints out the contents of the file to system console, but it can be easily modified to store it in the local file system, or transfer elsewhere over the network, etc:
Continue reading

In my previous two posts I described:

Of course both of the operations above can also be accomplished with the API. However, in this post I am going to show how to retrieve a data object which has a related geopoint. Consider the following object:
address object with geo - Feature 101: Loading data objects with related geopoints using API

The Address table has the location column of the GEOPOINT RELATIONSHIP type. There are three data objects in the table and one of them has a related geopoint. The geopoint is shown in the screenshot below.

Notice the geopoint’s metadata ( city: NEW YORK CITY ):

Continue reading

In my post yesterday I described how to declare a relationship in a data table schema with a geopoint. Now that you know how to create a table column which contains one or more geo points, I am going to show how to populate it with data.

If you follow the post from yesterday and add a table column of the GEOPOINT  type, your data objects in Backendless console will appear as shown below. Notice the location column:
geopoint relationship column in table - Feature 100: Creating relationships between data objects and geopoints

Continue reading

Data objects in Backendless may have related properties not only with other tables, but also with Geopoints. These relationships may be declared programmatically or using Backendless Console. In this post I review the process of declaring a Data-to-Geo relationship in a data table schema.

Once a relationship is declared, you can do the following:

  • Link/unlink/manage data objects with related geo points using console.
  • Use Backendless code generator to create client-side code which reflects the structure of the tables.
    Continue reading

Previously I have reviewed multiple techniques for loading data objects from the persistent server-side storage. There is a list of all articles categorized by topic. In this post I am going to review the API for loading data objects using an SQL query. I already wrote once about SQL queries in Backendless and that post described how to test queries using console. I recommend reading that post before reviewing the samples below.

Consider the following data tables:

There are 2 Person objects:
person objects - Feature 98: Loading data objects from server with an SQL query

Continue reading

Data objects stored in Backendless may have related objects through one-to-one or one-to-many collections. When objects are retrieved on the client side, these relations are materialized as collections of data in object’s fields or properties. Consider the following data object:
person with related addresses -  Feature 97: Update object's related collections using API

Continue reading

In my previous post where I showed how to update data objects in the persistent storage, my class for the data object looked like this:

Notice the class does not include any fields/properties for objectId , created or updated fields. Nevertheless, the call to save the updated object knew that it is already stored in Backendless. This is possible as a result of a feature that lets you declare any field or property your app might need. Also, notice the class neither implements any special interfaces nor extends any base Backendless classes – a pure data object class.

Once an object is stored in the Backendless data storage, any of its properties (except for the system ones) can be updated using the data update API. The API works the same way as the initial call for saving the object. To update a property value, simply modify it in the instance representing the saved object. The example below retrieves a saved object, modifies the “name” property and saves it back in the data store.

The data table and schema look as shown in the screenshots below:
person table - Feature 95: Updating data objects using API

Continue reading