imports/vx/server/daemon/recordimporter.js
/**
     * Batch insert an array into a collection.
     *
     * @param {object} coll Collection into which records should be inserted.
     * @param {object} uploadStats Upload Stats object.
     * @param {string} taskName Task name for logging.
     * @param {array} insertArray Array to be inserted.
     */
Batch insert an array into a collection.
@param {object} coll Collection into which records should be inserted.
@param {object} uploadStats Upload Stats object.
@param {string} taskName Task name for logging.
@param {array} insertArray Array to be inserted.
Batch insert an array into a collection . @param { object } coll Collection into which records should be inserted . @param { object } uploadStats Upload Stats object . @param { string } taskName Task name for logging . @param { array } insertArray Array to be inserted .
performBatchInsert(coll, uploadStats, taskName, insertArray) {
        const records = _.pluck(insertArray, "record")
        coll.batchInsert(records, error => {
            OLog.debug(`recordimporter.js performBatchInsert domainId=${uploadStats.domain} ` +
                `uploadType=${uploadStats.uploadType} userId=${uploadStats.userId} taskName=${taskName} ` +
                `*inserted* records=${insertArray.length}`)
            if (error) {
                OLog.error("recordimporter.js performBatchInsert unexpected error occurred during batch " +
                    `insert error=${error}`)
                return
            }
        });
    }
performBatchInsert ( coll , uploadStats , taskName , insertArray ) { const records = _ . pluck ( insertArray , "record" ) coll . batchInsert ( records , error => { OLog . debug ( ` ${ uploadStats . domain } ` + ` ${ uploadStats . uploadType } ${ uploadStats . userId } ${ taskName } ` + ` ${ insertArray . length } ` ) if ( error ) { OLog . error ( "recordimporter.js performBatchInsert unexpected error occurred during batch " + ` ${ error } ` ) return } } ) ; }
Batch insert an array into a collection.
Batch insert an array into a collection .