How to load specific table relations in queryBuilder while fetching data in backendless using js?
Have you tried the examples from here https://backendless.com/docs/js/data_single_step_retrieval.html ?
I have two tables A(parent), B(child).
A table have 1:N relationship with B table.
I am fetching B table data using A table. How i can get particular fields in B table in this case?
how i can set SortBy for created field in B table?
You can not get it in a single api-call, it can be done with another api-call
When you request child records in another api-call you can use paging, sorting, propsFiltering
In the example, how i can sort the data using " loadRelationsQueryBuilder"?
Oh, sorry, it’s not supported yet, but I’ve created an internal ticket to add this, for reference ticket is: BKNDLSS-18026, we will fix it as soon as possible and notify you here.
As workaround I can propose you to use " Inverted Relation Retrieval", here is a doc:
var childStorage = Backendless.Persistence.of( "CHILD_TABLE_NAME" ); var queryBuilder = Backendless.DataQueryBuilder.create(); queryBuilder.setWhereClause( "PAREN_TABLE_NAME[RELATION_NAME].objectId='PARENT_OBJECT_ID'" );
queryBuilder.setSortBy( “age” );
var sortedRelations = await childStorage.find( queryBuilder );