Hello!I tried to get relations users from column “Favorite”. I need usersID from this column
Methods from https://backendless.com/documentation/data/js/data_relations_retrieve.htm
But had retrieving only parents objects
Example:
http://api.backendless.com/v1/data/Items/08BEF67E-FDDE-61B6-FF66-25EA83E7B300?loadRelations=Favorite
http://api.backendless.com/v1/data/Items/08BEF67E-FDDE-61B6-FF66-25EA83E7B300
no different;
var dataStore = Backendless.Persistence.of( Items );
var result = dataStore.findFirst();
result = dataStore.loadRelations( result, ["Favorite"] );
console.log(result);
undefined;
var query = new Backendless.DataQuery();
query.options = {related:["Favorite"]};
var resultCollection = Backendless.Persistence.of( Items ).find( query );
console.log(resultCollection);
//no different
var data = Backendless.Persistence.of( Items ).find();
console.log(data);
I expected only objects have objects in “favorite”?
This problems troubling me to finish project How can i reverse retrieve, for example:
i need to retrieve all objectId from relation column Items.Favorite from table “User” in parent table “Items”
Hi Eugen,
I apologize, I missed your original post. If I understood your question correctly, you need to load only specific property from every object in a related table? Specifically, get objectId for every User object related to a specific Item, is that correct?
Regards,
Mark
Hi Mark.
Yes it is
I try with one relation to create “Favorite list”(include “Items”) for every user, and “User list”(include “Users”) for every Item
Ok, this crazy code help me to find relation:
var resultCollection = Backendless.Persistence.of(Classes.Items).find( { options: {sortBy: 'objectId'}, relations: ['Category']}
console.log(resultCollection.data[0].Category[1]);
But relation in User table retrieve only “null” but this wrong and column “Create” have objects
var resultCollection = Backendless.Persistence.of(Users).find( { options: {sortBy: 'objectId'}, relations: ['Create']} );
console.log(resultCollection.data[0].Create);