POST /data/[table] of a data relation column

Passing an invalid key to a data relation column doesn’t throw an error? It just puts a NULL in the column?

Is this somewhere a setting?

Workaround is a business logic layer but I was not expecting this behaviour, that’s why you have a data relation column (foreign keys in a relational DB).

Could you please demonstrate with a sample rest request what you are doing?

Hi Mark,

I looked at my tests again and I used the wrong objectid, I fixed this but now I get a strange error:

  1. the model

  1. GET

  1. POST
  • edited copy of the GET response body
  • I want to add a passenger to a car
  • the full error is :“Wrong json format: Cannot deserialize instance of java.util.HashMap<java.lang.Object,java.lang.Object> out of START_ARRAY token\n at [Source: UNKNOWN; line: -1, column: -1]”

To add a passenger to a car, you need to use the API that establishes a relation. The REST Console doesn’t provide UI for that functionality. The documentation for the API call is available here:
https://backendless.com/docs/rest/data_set_add_relation_rest.html

“Both parent and child objects must exist in the Backendless storage.” + call to update the relation.

So 2 call for one record, better in one business logic call?

About business logic calls: if the business logic is just one SQL (*Advanced Object Retrieval"), how is the performance compared to a Database API with the same SQL?

If I understand your question correctly:
Through the business logic, you essentially use the same API requests, + the business logic itself. Therefore, normal use of the API will be more productive.
It will be more convenient for you to use the API for Deep Save:
https://backendless.com/docs/rest/data_deepsaveoverview.html
Advanced Object Retrieval:
https://backendless.com/docs/rest/data_general_api.html|

Best Regards, Nikita.

I was wondering how much delay the blockly way of working is, are the business logics compiled or everytime interpreted?

Business logic uses JS. It is interpretable.

Thx for the info! :slightly_smiling_face:

To clarify, business logic written with BLOCKS uses JS.
You can also write it in another language. Depending on this, it may be compiled.

Best Regards, Nikita.

1 Like