async execUnorderedBulkOpSafely(unorderedBulkOp) {
    let errors = [];
    let result = null;

    try {
      const log = await unorderedBulkOp.execute();
      result = log.result;
    }
    catch (err) {
      result = err.result;
      errors = err.writeErrors || [err];
      errors.map((err) => {
        const moreDetailErr = err.err;
        return { _id: moreDetailErr.op._id, message: err.errmsg };
      });
    }

    const insertedCount = result.nInserted + result.nUpserted;
    const modifiedCount = result.nModified;

    return {
      insertedCount,
      modifiedCount,
      errors,
    };
  }
/**
   * execute unorderedBulkOp and ignore errors
   *
   * @memberOf ImportService
   * @param {object} unorderedBulkOp result of Model.collection.initializeUnorderedBulkOp()
   * @return {object} e.g. { insertedCount: 10, errors: [...] }
   */
execute unorderedBulkOp and ignore errors
@memberOf ImportService
@param {object} unorderedBulkOp result of Model.collection.initializeUnorderedBulkOp()
@return {object} e.g.
execute unorderedBulkOp and ignore errors @memberOf ImportService @param { object } unorderedBulkOp result of Model . collection . initializeUnorderedBulkOp () @return { object } e . g .
async execUnorderedBulkOpSafely(unorderedBulkOp) {
    let errors = [];
    let result = null;
    try {
      const log = await unorderedBulkOp.execute();
      result = log.result;
    }
    catch (err) {
      result = err.result;
      errors = err.writeErrors || [err];
      errors.map((err) => {
        const moreDetailErr = err.err;
        return { _id: moreDetailErr.op._id, message: err.errmsg };
      });
    }
    const insertedCount = result.nInserted + result.nUpserted;
    const modifiedCount = result.nModified;
    return {
      insertedCount,
      modifiedCount,
      errors,
    };
  }
async execUnorderedBulkOpSafely ( unorderedBulkOp ) { let errors = [ ] ; let result = null ; try { const log = await unorderedBulkOp . execute ( ) ; result = log . result ; } catch ( err ) { result = err . result ; errors = err . writeErrors || [ err ] ; errors . map ( ( err ) => { const moreDetailErr = err . err ; return { _id : moreDetailErr . op . _id , message : err . errmsg } ; } ) ; } const insertedCount = result . nInserted + result . nUpserted ; const modifiedCount = result . nModified ; return { insertedCount , modifiedCount , errors , } ; }
execute unorderedBulkOp and ignore errors
 @memberOf ImportService
 @param {object} unorderedBulkOp result of Model.collection.initializeUnorderedBulkOp()
 @return {object} e.g.
execute unorderedBulkOp and ignore errors @memberOf ImportService @param { object } unorderedBulkOp result of Model . collection . initializeUnorderedBulkOp () @return { object } e . g .