| 1 | # Copyright 2016 - 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::Op::_DropDatabase; | ||||||||||
| 18 | |||||||||||
| 19 | # Implements a database drop; returns a MongoDB::CommandResult | ||||||||||
| 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 | |||||||||||
| 26 | 59 | ▶ | use MongoDB::Op::_Command; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | |||||||||||
| 28 | 59 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 29 | |||||||||||
| 30 | 59 | with $_ for qw( | |||||||||
| 31 | MongoDB::Role::_PrivateConstructor | ||||||||||
| 32 | MongoDB::Role::_DatabaseOp | ||||||||||
| 33 | MongoDB::Role::_WriteOp | ||||||||||
| 34 | ); | ||||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | sub execute { | ||||||||
|
Subroutine
execute: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 37 | 0 | my ( $self, $link ) = @_; | |||||||||
| 38 | |||||||||||
| 39 | my $op = MongoDB::Op::_Command->_new( | ||||||||||
| 40 | db_name => $self->db_name, | ||||||||||
| 41 | query => [ | ||||||||||
| 42 | dropDatabase => 1, | ||||||||||
| 43 | 0 | ▶ | ( $link->supports_helper_write_concern ? ( @{ $self->write_concern->as_args } ) : () ), | ||||||||
|
Branch: 1 branch
| |||||||||||
| 44 | ], | ||||||||||
| 45 | query_flags => {}, | ||||||||||
| 46 | bson_codec => $self->bson_codec, | ||||||||||
| 47 | session => $self->session, | ||||||||||
| 48 | monitoring_callback => $self->monitoring_callback, | ||||||||||
| 49 | ); | ||||||||||
| 50 | |||||||||||
| 51 | 0 | my $res = $op->execute($link); | |||||||||
| 52 | 0 | $res->assert_no_write_concern_error; | |||||||||
| 53 | |||||||||||
| 54 | 0 | return $res; | |||||||||
| 55 | } | ||||||||||
| 56 | |||||||||||
| 57 | 59 | 1; | |||||||||