bulkUpsertByName(sampleQueryBody, user, readOnlyFields) {
    if (!sampleQueryBody || !Array.isArray(sampleQueryBody)) {
      return Promise.resolve([]);
    }

    const promises = sampleQueryBody.map((sampleReq) => {
      // Throw error if sample is upserted with read-only field.
      try {
        commonUtils.noReadOnlyFieldsInReq(sampleReq, readOnlyFields);
        return upsertOneSample(sampleReq, true, user);
      } catch (err) {
        return Promise.resolve({ isFailed: true, explanation: err });
      }
    });

    return Promise.all(promises);
  }
/**
   * Upsert multiple samples in Redis concurrently.
   * @param  {Object} sampleQueryBody - Query body object
   * @param {Object} user - The user performing the write operation
   * @param {Array} readOnlyFields - An array of read-only-fields
   * @returns {Array} - Resolves to an array of resolved promises
   */
Upsert multiple samples in Redis concurrently.
Upsert multiple samples in Redis concurrently .
bulkUpsertByName(sampleQueryBody, user, readOnlyFields) {
    if (!sampleQueryBody || !Array.isArray(sampleQueryBody)) {
      return Promise.resolve([]);
    }
    const promises = sampleQueryBody.map((sampleReq) => {
      try {
        commonUtils.noReadOnlyFieldsInReq(sampleReq, readOnlyFields);
        return upsertOneSample(sampleReq, true, user);
      } catch (err) {
        return Promise.resolve({ isFailed: true, explanation: err });
      }
    });
    return Promise.all(promises);
  }
bulkUpsertByName ( sampleQueryBody , user , readOnlyFields ) { if ( ! sampleQueryBody || ! Array . isArray ( sampleQueryBody ) ) { return Promise . resolve ( [ ] ) ; } const promises = sampleQueryBody . map ( ( sampleReq ) => { try { commonUtils . noReadOnlyFieldsInReq ( sampleReq , readOnlyFields ) ; return upsertOneSample ( sampleReq , true , user ) ; } catch ( err ) { return Promise . resolve ( { isFailed : true , explanation : err } ) ; } } ) ; return Promise . all ( promises ) ; }
Upsert multiple samples in Redis concurrently.
Upsert multiple samples in Redis concurrently .
// Throw error if sample is upserted with read-only field.