code: async function _removeManyHandler(
    ownerModel,
    ownerId,
    childModel,
    associationName,
    request,
    Log
  ) {
    try {
      // EXPL: make a copy of the payload so that request.payload remains unchanged
      let payload = request.payload.map(item => {
        return _.isObject(item) ? _.assignIn({}, item) : item
      })
      if (_.isEmpty(request.payload)) {
        throw Boom.badRequest('Payload is empty.')
      }
      let ownerObject = await ownerModel
        .findOne({ _id: ownerId })
        .select(associationName)
      if (ownerObject) {
        try {
          if (
            ownerModel.routeOptions &&
            ownerModel.routeOptions.remove &&
            ownerModel.routeOptions.remove[associationName] &&
            ownerModel.routeOptions.remove[associationName].pre
          ) {
            payload = await ownerModel.routeOptions.remove[associationName].pre(
              payload,
              request,
              Log
            )
          }
        } catch (err) {
          handleError(
            err,
            'There was a preprocessing error while removing the association.',
            Boom.badRequest,
            Log
          )
        }
  
        for (let childId of payload) {
          try {
            await _removeAssociation(
              ownerModel,
              ownerObject,
              childModel,
              childId,
              associationName,
              Log
            )
          } catch (err) {
            handleError(
              err,
              'There was an internal error while removing the associations.',
              Boom.badImplementation,
              Log
            )
          }
        }
        return true
      } else {
        throw Boom.notFound('No owner resource was found with that id.')
      }
    } catch (err) {
      handleError(err, null, null, Log)
    }
  }
docs: Removes multiple associations from a document
  @param ownerModel: The model that is being removed from.
  @param ownerId: The id of the owner document.
  @param childModel: The model that is being removed.
  @param associationName: The name of the association from the ownerModel's perspective.
  @param request: The Hapi request object, or a container for the wrapper payload.
  @param Log: A logging object
  @returns {object} A promise returning true if the remove succeeds.
  @private