node_modules/@google-cloud/firestore/build/src/write-batch.js
/**
     * Commits all pending operations to the database and verifies all
     * preconditions.
     *
     * The writes in the batch are not applied atomically and can be applied out
     * of order.
     *
     * @private
     */
Commits all pending operations to the database and verifies all
preconditions.

The writes in the batch are not applied atomically and can be applied out
of order.

@private
Commits all pending operations to the database and verifies all preconditions . The writes in the batch are not applied atomically and can be applied out of order . @private
async bulkCommit() {
        this._committed = true;
        const tag = util_1.requestTag();
        await this._firestore.initializeIfNeeded(tag);
        const database = this._firestore.formattedName;
        const request = { database, writes: [] };
        const writes = this._ops.map(op => op());
        for (const req of writes) {
            if (req.precondition) {
                req.write.currentDocument = req.precondition;
            }
            request.writes.push(req.write);
        }
        const response = await this._firestore.request('batchWrite', request, tag);
        return (response.writeResults || []).map((result, i) => {
            const status = response.status[i];
            const error = new google_gax_1.GoogleError(status.message || undefined);
            error.code = status.code;
            return new BatchWriteResult(result.updateTime ? timestamp_1.Timestamp.fromProto(result.updateTime) : null, error);
        });
    }
async bulkCommit ( ) { this . _committed = true ; const tag = util_1 . requestTag ( ) ; await this . _firestore . initializeIfNeeded ( tag ) ; const database = this . _firestore . formattedName ; const request = { database , writes : [ ] } ; const writes = this . _ops . map ( op => op ( ) ) ; for ( const req of writes ) { if ( req . precondition ) { req . write . currentDocument = req . precondition ; } request . writes . push ( req . write ) ; } const response = await this . _firestore . request ( 'batchWrite' , request , tag ) ; return ( response . writeResults || [ ] ) . map ( ( result , i ) => { const status = response . status [ i ] ; const error = new google_gax_1 . GoogleError ( status . message || undefined ) ; error . code = status . code ; return new BatchWriteResult ( result . updateTime ? timestamp_1 . Timestamp . fromProto ( result . updateTime ) : null , error ) ; } ) ; }
Commits all pending operations to the database and verifies all
 preconditions.
Commits all pending operations to the database and verifies all preconditions .