line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# Copyright 2015 - 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
|
|
|
59
|
|
274282
|
use strict; |
|
59
|
|
|
|
|
144
|
|
|
59
|
|
|
|
|
1673
|
|
16
|
59
|
|
|
59
|
|
433
|
use warnings; |
|
59
|
|
|
|
|
123
|
|
|
59
|
|
|
|
|
2145
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
package MongoDB::Role::_BypassValidation; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# MongoDB interface for optionally applying bypassDocumentValidation |
21
|
|
|
|
|
|
|
# to a command |
22
|
|
|
|
|
|
|
|
23
|
59
|
|
|
59
|
|
418
|
use version; |
|
59
|
|
|
|
|
117
|
|
|
59
|
|
|
|
|
426
|
|
24
|
|
|
|
|
|
|
our $VERSION = 'v2.2.2'; |
25
|
|
|
|
|
|
|
|
26
|
59
|
|
|
59
|
|
4282
|
use Moo::Role; |
|
59
|
|
|
|
|
111
|
|
|
59
|
|
|
|
|
376
|
|
27
|
|
|
|
|
|
|
|
28
|
59
|
|
|
|
|
666
|
use MongoDB::_Types qw( |
29
|
|
|
|
|
|
|
Boolish |
30
|
59
|
|
|
59
|
|
18947
|
); |
|
59
|
|
|
|
|
216
|
|
31
|
59
|
|
|
59
|
|
61570
|
use boolean; |
|
59
|
|
|
|
|
130
|
|
|
59
|
|
|
|
|
524
|
|
32
|
|
|
|
|
|
|
|
33
|
59
|
|
|
59
|
|
4163
|
use namespace::clean; |
|
59
|
|
|
|
|
141
|
|
|
59
|
|
|
|
|
415
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
has bypassDocumentValidation => ( |
36
|
|
|
|
|
|
|
is => 'ro', |
37
|
|
|
|
|
|
|
isa => Boolish, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# args not unpacked for efficiency; args are self, validation supported |
41
|
|
|
|
|
|
|
# flag, original command; returns (possibly modified) command |
42
|
|
|
|
|
|
|
sub _maybe_bypass { |
43
|
0
|
0
|
0
|
0
|
|
|
push @{ $_[2] }, |
|
0
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
bypassDocumentValidation => true if $_[1] && $_[0]->bypassDocumentValidation; |
45
|
0
|
|
|
|
|
|
return $_[2]; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |