Bulk create with relation

I need to save a number of objects. The objects include some one to one relations.

I can loop through the objects and then set the relation and this will work fine. But this uses 2 API calls for every object and potentially takes some time to complete depending on the number of objects.

Backendless.Data.of( "table" ).save( objects )
Backendless.Data.of( "table" ).setRelation({ objectId: id }, relation, [{ objectId: relationObjectId }])

I can loop through the objects and use deepSave. This will use 1 API call per object but may still take some time to complete depending on the number of objects.
Backendless.Data.of( "table" ).deepSave( objectWithRelations )

I can use bulkCreate to create all the objects in one hit. However I then need to loop through the saved objects and set the relations. Again this might take time to complete.
Backendless.Data.of( "table" ).bulkCreate( objects )

Is there a way to bulk deepsave my objects? I have tried passing an array of objects including the relations but it doesn’t seem to create the relation.

Backendless Version (3.x / 5.x, Online / Managed / Pro )

Cloud 99 plan

Client SDK (REST / Android / Objective-C / Swift / JS )

JS API

Hi, @Tony_Goodchild

Unfortunately, there is no bulk deepsave. A transaction can be used as an option. Note that multiple database queries can be grouped into one transaction and executed. But if one of these grouped database operations fails, the whole transaction is rolled back - meaning that any other changes within the same transaction are canceled.

Overview - Backendless SDK for JavaScript API Documentation

Regards,
Marina