| 1 | # Copyright 2014 - present MongoDB, Inc. | ||
| 2 | # | ||
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 4 | # you may not use this file except in compliance with the License. | ||
| 5 | # You may obtain a copy of the License at | ||
| 6 | # | ||
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 | ||
| 8 | # | ||
| 9 | # Unless required by applicable law or agreed to in writing, software | ||
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, | ||
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 12 | # See the License for the specific language governing permissions and | ||
| 13 | # limitations under the License. | ||
| 14 | |||
| 15 | 59 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | 59 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 17 | package MongoDB::UpdateResult; | ||
| 18 | |||
| 19 | # ABSTRACT: MongoDB update result object | ||
| 20 | |||
| 21 | 59 | ▶ | use version; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 22 | 59 | our $VERSION = 'v2.2.2'; | |
| 23 | |||
| 24 | 59 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 25 | 59 | ▶ | use MongoDB::_Constants; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 26 | 59 | ▶ | use MongoDB::_Types qw( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 27 | Numish | ||
| 28 | 59 | ); | |
| 29 | 59 | ▶ | use Types::Standard qw( |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 30 | Undef | ||
| 31 | 59 | ); | |
| 32 | 59 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 33 | |||
| 34 | 59 | with $_ for qw( | |
| 35 | MongoDB::Role::_PrivateConstructor | ||
| 36 | MongoDB::Role::_WriteResult | ||
| 37 | ); | ||
| 38 | |||
| 39 | #pod =attr matched_count | ||
| 40 | #pod | ||
| 41 | #pod The number of documents that matched the filter. | ||
| 42 | #pod | ||
| 43 | #pod =cut | ||
| 44 | |||
| 45 | 59 | has matched_count => ( | |
| 46 | is => 'ro', | ||
| 47 | required => 1, | ||
| 48 | isa => Numish, | ||
| 49 | ); | ||
| 50 | |||
| 51 | #pod =attr modified_count | ||
| 52 | #pod | ||
| 53 | #pod The number of documents that were modified. Note: this is only available | ||
| 54 | #pod from MongoDB version 2.6 or later. It will return C<undef> from earlier | ||
| 55 | #pod servers. | ||
| 56 | #pod | ||
| 57 | #pod You can call C<has_modified_count> to find out if this attribute is | ||
| 58 | #pod defined or not. | ||
| 59 | #pod | ||
| 60 | #pod =cut | ||
| 61 | |||
| 62 | 59 | has modified_count => ( | |
| 63 | is => 'ro', | ||
| 64 | required => 1, | ||
| 65 | isa => (Numish|Undef), | ||
| 66 | ); | ||
| 67 | |||
| 68 | 0 | ▶ | sub has_modified_count { |
|
Subroutine
has_modified_count: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 69 | 0 | my ($self) = @_; | |
| 70 | 0 | return defined( $self->modified_count ); | |
| 71 | } | ||
| 72 | |||
| 73 | #pod =attr upserted_id | ||
| 74 | #pod | ||
| 75 | #pod The identifier of the inserted document if an upsert took place. If | ||
| 76 | #pod no upsert took place, it returns C<undef>. | ||
| 77 | #pod | ||
| 78 | #pod =cut | ||
| 79 | |||
| 80 | 59 | has upserted_id => ( | |
| 81 | is => 'ro', | ||
| 82 | ); | ||
| 83 | |||
| 84 | 59 | 1; | |
| 85 | |||
| 86 | __END__ | ||