GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  MONGODB::BULKWRITERESULT (3)

.ds Aq ’

NAME

MongoDB::BulkWriteResult - MongoDB bulk write result document

CONTENTS

VERSION

version v1.2.3

SYNOPSIS



    # returned directly
    my $result = $bulk->execute;

    # from a WriteError or WriteConcernError
    my $result = $error->result;

    if ( $result->acknowledged ) {
        ...
    }



DESCRIPTION

This 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.

ATTRIBUTES

    inserted_count

Number of documents inserted

    upserted_count

Number of documents upserted

    matched_count

Number of documents matched for an update or replace operation.

    deleted_count

Number of documents removed

    modified_count

Number 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.

    upserted

An array reference containing information about upserted documents (if any). Each document will have the following fields:
o index X 0-based index indicating which operation failed
o _id X the object ID of the upserted document

    upserted_ids

A hash reference built lazily from upserted mapping indexes to object IDs.

    inserted

An array reference containing information about inserted documents (if any). Documents are just as in upserted.

    inserted_ids

A hash reference built lazily from inserted mapping indexes to object IDs.

    write_errors

An array reference containing write errors (if any). Each error document will have the following fields:
o index X 0-based index indicating which operation failed
o code X numeric error code
o errmsg X textual error string
o op X a representation of the actual operation sent to the server

    write_concern_errors

An array reference containing write concern errors (if any). Each error document will have the following fields:
o index X 0-based index indicating which operation failed
o code X numeric error code

    op_count

The number of operations sent to the database.

    batch_count

The number of database commands issued to the server. This will be less than the op_count if multiple operations were grouped together.

METHODS

    assert

Throws an error if write errors or write concern errors occurred.

    assert_no_write_error

Throws a MongoDB::WriteError if count_write_errors is non-zero; otherwise returns 1.

    assert_no_write_concern_error

Throws a MongoDB::WriteConcernError if count_write_concern_errors is non-zero; otherwise returns 1.

    count_write_errors

Returns the number of write errors

    count_write_concern_errors

Returns the number of write errors

    last_code

Returns the last code field from either the list of write_errors or write_concern_errors or 0 if there are no errors.

    last_errmsg

Returns 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_wtimeout

True if a write concern timed out or false otherwise.

AUTHORS

o David Golden <david@mongodb.com>
o Mike Friedman <friedo@friedo.com>
o Kristina Chodorow <k.chodorow@gmail.com>
o Florian Ragwitz <rafl@debian.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2016 by MongoDB, Inc..

This is free software, licensed under:



  The Apache License, Version 2.0, January 2004



Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 MONGODB::BULKWRITERESULT (3) 2016-03-08

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.