createMany (records, opts) {
    // Default values for arguments
    records || (records = [])
    opts || (opts = {})
    const originalRecords = records
    let adapterResponse

    // Fill in "opts" with the Mapper's configuration
    utils._(opts, this)
    opts.adapter = this.getAdapterName(opts)

    // beforeCreateMany lifecycle hook
    opts.op = 'beforeCreateMany'
    return this._runHook(opts.op, records, opts).then((_recordValues) => {
      // Allow for re-assignment from lifecycle hook
      records = _recordValues !== undefined ? _recordValues : records
      // Deep pre-create belongsTo relations
      const belongsToRelationData = {}
      opts.with || (opts.with = [])
      let tasks = []
      utils.forEachRelation(this, opts, (def, optsCopy) => {
        const relationData = records
          .map((record) => def.getLocalField(record))
          .filter(Boolean)
        if (def.type === belongsToType && relationData.length === records.length) {
          // Create belongsTo relation first because we need a generated id to
          // attach to the child
          optsCopy.raw = false
          tasks.push(def.createLinked(relationData, optsCopy).then((relatedRecords) => {
            records.forEach((record, i) => def.setForeignKey(record, relatedRecords[i]))
          }).then((relatedRecords) => {
            def.setLocalField(belongsToRelationData, relatedRecords)
          }))
        }
      })
      return utils.Promise.all(tasks).then(() => {
        opts.op = 'createMany'
        return this._invokeAdapterMethod(opts.op, records, opts)
      }).then((result) => {
        adapterResponse = result
      }).then(() => {
        const createdRecordsData = opts.raw ? adapterResponse.data : adapterResponse

        // Deep post-create hasOne relations
        tasks = []
        utils.forEachRelation(this, opts, (def, optsCopy) => {
          const relationData = records
            .map((record) => def.getLocalField(record))
            .filter(Boolean)
          if (relationData.length !== records.length) {
            return
          }

          optsCopy.raw = false
          const belongsToData = def.getLocalField(belongsToRelationData)
          let task
          // Create hasMany and hasOne after the main create because we needed
          // a generated id to attach to these items
          if (def.type === hasManyType) {
            // Not supported
            this.log('warn', 'deep createMany of hasMany type not supported!')
          } else if (def.type === hasOneType) {
            createdRecordsData.forEach((createdRecordData, i) => {
              def.setForeignKey(createdRecordData, relationData[i])
            })
            task = def.getRelation().createMany(relationData, optsCopy).then((relatedData) => {
              createdRecordsData.forEach((createdRecordData, i) => {
                def.setLocalField(createdRecordData, relatedData[i])
              })
            })
          } else if (def.type === belongsToType && belongsToData && belongsToData.length === createdRecordsData.length) {
            createdRecordsData.forEach((createdRecordData, i) => {
              def.setLocalField(createdRecordData, belongsToData[i])
            })
          }
          if (task) {
            tasks.push(task)
          }
        })
        return utils.Promise.all(tasks).then(() => {
          return this._commitChanges(originalRecords, createdRecordsData)
        })
      })
    }).then((records) => {
      if (opts.raw) {
        adapterResponse.data = records
      } else {
        adapterResponse = records
      }
      const result = this._end(adapterResponse, opts)
      opts.op = 'afterCreateMany'
      return this._runHook(opts.op, records, opts, result)
    })
  }
Given an array of records, batch create them via an adapter.

{@link Mapper#beforeCreateMany} will be called before calling the adapter.
{@link Mapper#afterCreateMany} will be called after calling the adapter.

@example
// Create and save several new blog posts
PostMapper.createMany([{
  title: 'Modeling your data',
  status: 'draft'
}, {
  title: 'Reading data',
  status: 'draft'
}]).then((posts) => {
  console.log(posts[0]); // { id: 1234, status: 'draft', ... }
  console.log(posts[1]); // { id: 1235, status: 'draft', ... }
});

@fires Mapper#beforeCreate
@fires Mapper#afterCreate
@method Mapper#createMany
@param {Record[]} records Array of records to be created in one batch.
@param {object} [opts] Configuration options. Refer to the `createMany`
method of whatever adapter you're using for more configuration options.
@param {boolean} [opts.adapter={@link Mapper#defaultAdapter}] Name of the
adapter to use.
@param {boolean} [opts.noValidate={@link Mapper#noValidate}] See {@link Mapper#noValidate}.
@param {boolean} [opts.notify={@link Mapper#notify}] See {@link Mapper#notify}.
@param {boolean} [opts.raw={@link Mapper#raw}] See {@link Mapper#raw}.
@param {string[]} [opts.with=[]] Relations to create in a cascading
create if `records` contains nested relations. NOT performed in a
transaction. Each nested create will result in another {@link Mapper#createMany}
call.
@param {string[]} [opts.pass=[]] Relations to send to the adapter as part
of the payload. Normally relations are not sent.
@returns {Promise} Resolves with the created records.
@since 3.0.0
@tutorial ["http://www.js-data.io/v3.0/docs/saving-data","Saving data"]