|
NAMEMongoDB::BulkWriteResult - MongoDB bulk write result documentVERSIONversion v2.2.2SYNOPSIS# returned directly my $result = $bulk->execute; # from a WriteError or WriteConcernError my $result = $error->result; if ( $result->acknowledged ) { ... } DESCRIPTIONThis class encapsulates the results from a bulk write operation. It may be returned directly from "execute" or it may be in the "result" attribute of a "MongoDB::DatabaseError" subclass like "MongoDB::WriteError" or "MongoDB::WriteConcernError".ATTRIBUTESinserted_countNumber of documents insertedupserted_countNumber of documents upsertedmatched_countNumber of documents matched for an update or replace operation.deleted_countNumber of documents removedmodified_countNumber of documents actually modified by an update operation. This is not necessarily the same as "matched_count" if the document was not actually modified as a result of the update.This field is not available from legacy servers before version 2.6. If results are seen from a legacy server (or from a mongos proxying for a legacy server) this attribute will be "undef". You can call "has_modified_count" to find out if this attribute is defined or not. upsertedAn array reference containing information about upserted documents (if any). Each document will have the following fields:
upserted_idsA hash reference built lazily from "upserted" mapping indexes to object IDs.insertedAn array reference containing information about inserted documents (if any). Documents are just as in "upserted".inserted_idsA hash reference built lazily from "inserted" mapping indexes to object IDs.write_errorsAn array reference containing write errors (if any). Each error document will have the following fields:
write_concern_errorsAn array reference containing write concern errors (if any). Each error document will have the following fields:
op_countThe number of operations sent to the database.batch_countThe number of database commands issued to the server. This will be less than the "op_count" if multiple operations were grouped together.METHODSassertThrows an error if write errors or write concern errors occurred.assert_no_write_errorThrows a MongoDB::WriteError if "count_write_errors" is non-zero; otherwise returns 1.assert_no_write_concern_errorThrows a MongoDB::WriteConcernError if "count_write_concern_errors" is non-zero; otherwise returns 1.count_write_errorsReturns the number of write errorscount_write_concern_errorsReturns the number of write errorslast_codeReturns the last "code" field from either the list of "write_errors" or "write_concern_errors" or 0 if there are no errors.last_errmsgReturns the last "errmsg" field from either the list of "write_errors" or "write_concern_errors" or the empty string if there are no errors.last_wtimeoutTrue if a write concern timed out or false otherwise.AUTHORS
COPYRIGHT AND LICENSEThis software is Copyright (c) 2020 by MongoDB, Inc.This is free software, licensed under: The Apache License, Version 2.0, January 2004
Visit the GSP FreeBSD Man Page Interface. |