Backendless Support
Need Answer

bulk setRelation

we have bulkCreate / bulkUpdate for mass operations, and they work good, but typical database structure usually have relations with other tables. So, we also need bulkSetRelation (I guess order of items are preserved in output of bulkCreate, which ids could be used as one of arguments in bulkSetRelation)

Leave a Comment

Comments (3)


Hello Yuriy,

do you like to tie one parent with couple objects, or couple parent objects with couple child objects?

please provide full curl request that would appropriate for this use case


Well, in described case there would be several parents (returned ids from bulkCreate). Not sure about question with curl request. I'm using javascript sdk, so I would like to have something like:

  1. var persons = [];//there should be objects for bulkCreate
  2. var childrenArray1 = [];//there should be ids of objects for relation
  3. var childrenArray2 = [];//there should be ids of objects for relation
  4. Backendless.Data.of("Person").bulkCreate(persons)
  5. .then( function( res ) {
  6. return Backendless.Data.of("Person").bulkSetRelation(
  7. res, //parentObject array,
  8. "relationColumn1",
  9. childrenArray1)
  10. })
  11. .then( function( res ) {
  12. return Backendless.Data.of("Person").bulkSetRelation(
  13. res, //parentObject array,
  14. "relationColumn2",
  15. childrenArray2)
  16. })


Hi Yuriy,

Currently we only provide a method to set relation between a single parent and multiple child. So there is no "bulkSetRelation" yet. We'll discuss the possibility of adding this.