Message:

Subscribe rss
Blog categories
Spread the love

Performing a calculation on a group of database objects may be a complex task. For example, to calculate the sum of all orders for a customer would require retrieving all customer’s orders, iterating over them to calculate the mathematical sum of all amounts. This was yesterday! As of Backendless 4.4.0, you can use aggregate functions to calculate the average, sum, maximum and minimum values for a collection of objects without retrieving them from the server. Additionally, the system supports calculating object count for all records in the database or a record subset.

To use an aggregate function, simply request a property in a data retrieval request in the following format (the example below is for calculating the sum for the orderAmount  column):

The returned object includes the sum  property with the calculated value:

The name of the property can be modified by assigning an alias (using %20  to replace the spaces in the URL):

The result contains a value for the property named after the alias:

Grouping Results

Results can be grouped by a column. The column could be either in the same table or a related one. For example, the following request retrieves the sum of all orders grouped by related country:

Unlike the response above, the result for this query includes a collection of objects, each containing the sum for a related country:

It is also possible to apply a filter on the grouped values. This can be done using the having  clause. For example, the request below retrieves only the groups of countries where the total order amount is greater than 10000:

For more information about aggregate functions see the Backendless API documentation:

Spread the love

As we have announced earlier, we have discontinued the free plan in 3.x. We have written about it on our blog as well email newsletters. If your application was on the free plan in Backendless 3.x, you can either migrate it to Backendless 4 (which has a free plan and that is not going anywhere) or you can choose to upgrade the pricing plan in Backendless 3.x. To upgrade the pricing plan in 3.x, you need to:

  1. Login to Backendless console (https://develop.backendless.com/3.x) and select your app.
  2. Click the Manage icon and then select Billing.
  3. Add a credit card and then select a billing plan. Once a plan is selected, the API calls for the app will be automatically unblocked.

If you have any questions, please contact us on the support forum.

Posted in Status Update
Spread the love

Backendless Push Notifications are getting a much-needed facelift. Today, with the release of version 4.3.0 you will start noticing some improvements. Specifically, you will see the  DeviceRegistration data table:

devicereg table - Rethinking Device Registrations for Push Notifications

Continue reading
Spread the love

Backendless supports two approaches for saving data objects in the database: class-based approach and map/dictionary approach. With the class approach, you declare a class, instances of which represent individual objects stored in the database. With the introduction of Swift 4, it is important to add a new attribute to your Swift 4 classes. For example:

Notice the @objcMembers  attribute declaration in the class. The attribute allows Backendless SDK (which is written in Objective-C) to access object’s property values. If you do not add the attribute, objects retrieved from the server will not have properties initialized with the values.

It is also possible to set a project-wide configuration property. When you do that, you do not need to add @objcMembers  attribute, however, you will see warnings when the project is built. To set the project property, open “Build Settings” for the project target, locate “Swift 3 @objc inference” and set it to “On”.

swift3 prop inference - Declaring data classes in Swift 4

For additional information on the @objcMembers attribute, see the “inheriting from Objective-C Classes” section in the Swift 4 programming guide.

 

 

Posted in iOS
Spread the love

Data retrieval in Backendless has gotten significantly more powerful with the release of version 4.2.0. We added support for subquery into the syntax of whereClause . The improvement allows your apps to run two queries in the context of one request. The first query identifies a set of objects which is fed into the second query. Consider the following data schema:

users blogpost comment - Announcing Subqueries - advanced data retrieval from Backendless mBaaS Database

Suppose your app needs to get all blog posts where the person who posted a comment has a specific email address (say @backendless.com ). Using subqueries, it can be done with the following whereClause sent to the BlogPost table:

Let’s review how this whereClause is processed by Backendless:

  1. Backendless detects that the query at the top level uses the in()  operator.
  2. It checks if the contents of the  in()  operator have the format of a subquery and if so, evaluates it accordingly.
  3. The subquery contains an “internal whereClause”, which is:
    author.email LIKE '%@backendless.com'
    The internal whereClause is applied to the objects in the Comment table.
  4. For all found  Comment objects, Backendless gets a list of values for the blogPost.objectId column.
  5. The resulting set is fed into the  in()  operator which fetches the final set of objects from the  BlogPost table.

General SubQuery Syntax

The general syntax for subqueries is:

How it works:

  1. If internalWhereClause  is present, it is executed in the table identified by TableName.
  2. In the resulting set of records, values must be selected for the column identified by columnOrRelatedColumnName.optionalColumnName.
  3. If internalWhereClause is not present, the contents of the IN operator have the following syntax. It represents the entire set of values identified by the specified column: TableName.columnOrRelatedColumnName.optionalColumnName 
  4. The resulting set of values is used in the  IN operator, thus the final query ends up being:
    searchColumnOrRelatedColumnName IN ( value1, value2,, valueN ) 

Additional Examples

Consider the following data schema:

customer order items - Announcing Subqueries - advanced data retrieval from Backendless mBaaS Database

  1. Get all OrderItem  objects for a customer from New York :
    objectId in (Order[customer.address = 'New York'].items.objectId)
  2. Get all Customer  objects who spent more than 1.99 on an item:
    objectId in (Order[items.itemPrice > 1.99].customer.objectId )

Please let us know if you can think of additional examples you would like us to demonstrate.

Enjoy!

 

Spread the love

We believe that Backendless is great. We know that many of developers building with Backendless think so too. This is why we added support for referrals. It is built right into the Backendless console and every Backendless developer got his/her own invite code. There is a convenient way to access the “Invites” page by clicking the “Send an Invite” link:

send an invite - Introducing Invites and Referrals

The Invites and Referrals page is self-explanatory. It shows your own personal invite code and lets you send out an invite to anyone. You do not have to use the invite form, simply share the invite code and ask your developer friends use it when they create a Backendless app:

invite page - Introducing Invites and Referrals

The referral system follows the rules below:

  1. You cannot send out an invite while your app is on the free trial for the Cloud99 plan. Keep in mind that every app starts with a 14 days trial on the Cloud99 plan.
  2. The developer you invite may already have an account with Backendless. If they do not, they would need to register.
  3. An invite code can be entered only at the time when an app is being created. The “New App” popup has been modified to allow an invite code.
  4. Invite codes apply only to new apps. You cannot apply an invite code to an existing app.
  5. When a developer you invited upgrades their app to a billing plan, they get 25% off the plan’s price for the first 6 months. At the same time, you will get a $10.00 credit for your app, even if you are on the free plan.
  6. The referral discount does not apply to the Marketplace purchases.
  7. You (the inviting developer) can accumulate an unlimited number of credits and they will be automatically applied when you upgrade to a paid plan or make a purchase.

That’s all, it is a pretty simple system. Spread the Backendless love!

Spread the love

Codeless Programming is a general approach for creating programs without writing any code. When combined with the power of the Backendess mBaaS, Codeless becomes a powerful and super-efficient tool. In this post, I will describe how to use Codeless to create a custom Amazon Alexa skill. In the first part, you will develop a basic Alexa skill which replies with a static greeting to a voice command. The second post will delve into a more complex implementation.

You can see a demo of what you will build over the course of both posts in the video below:

Continue reading
Spread the love

Webinar 150x150 - Register for Codeless WebinarMark your calendars, we will be conducting a webinar to talk about Codeless. Get all the information about this exciting technology straight from the source. There will be a technical walkthrough and demos showing how to build with Codeless.

When: Aug 22, 2017, 1:00pm US Central Time
Host: Mark Piller, Backendless founder and CEO

Registration is required. Register now.

Posted in Webinar
Spread the love

The core of the Codeless technology we released last week is the Codeless Logic Designer. It is a visual environment for composing logic of your API/IoT services, Event Handlers, and Timers. The system uses “blocks”, a jigsaw puzzle-like UI components placed into categories. When you create a codeless service, you snap blocks to create the logic. As you do it, Backendless automatically generates the source code which will be executed once the logic is deployed. Check out the video below for an overview of the Codeless user interface:

Spread the love

codeless 300x200 - Announcing Codeless ProgrammingWith the release of Backendless Cloud v4.1.0 we added an amazing new feature called Codeless Programming. Using Codeless anyone can develop in Backendless without any knowledge of a programming language. The environment is fully visual and lets you create API/IoT Services, Backendless API Event Handlers and Timers. The system can be used to create programs of any complexity. Created logic can be deployed to become an instant API service accessible via REST API as well as dynamically generated native SDKs.  Codeless programs can be either independently standing services or can extend and enhance a Backendless application.