0

I am trying to go through the example mention in the documentation for the HasAndBelongsToMany relations. Documentation

For the Assembly and Parts example, the documentation says, it adds a function which can add part to assembly.

assembly.parts.add(part,
  function(err) {
  ...
});

But this adds only a single part to assembly. If I have to add multiple parts, do we have a function for that? I think calling this function in a loop multiple times is not an optimal way to do.

helloworld
  • 1,002
  • 3
  • 15
  • 27

1 Answers1

0

I don't think there is a way to add multiple items at once. There seems to be a similar question here. This might help you.

Sashi
  • 2,659
  • 5
  • 26
  • 38