/usr/lib/x86_64-linux-gnu/perl5/5.26/MongoDB.pm is in libmongodb-perl 1.8.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 | #
# Copyright 2009-2013 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
use 5.008;
use strict;
use warnings;
package MongoDB;
# ABSTRACT: Official MongoDB Driver for Perl
use version;
our $VERSION = 'v1.8.1';
# regexp_pattern was unavailable before 5.10, had to be exported to load the
# function implementation on 5.10, and was automatically available in 5.10.1
use if ($] eq '5.010000'), 're', 'regexp_pattern';
use Carp ();
use MongoDB::BSON;
use MongoDB::MongoClient;
use MongoDB::Database;
use MongoDB::Collection;
use MongoDB::DBRef;
use MongoDB::OID;
use MongoDB::Timestamp;
use MongoDB::BSON::Binary;
use MongoDB::BSON::Regexp;
use MongoDB::BulkWrite;
use MongoDB::_Link;
use MongoDB::_Protocol;
use BSON::Types;
*read_documents = \&MongoDB::BSON::decode_bson;
# regexp_pattern was unavailable before 5.10, had to be exported to load the
# function implementation on 5.10, and was automatically available in 5.10.1
if ( $] eq '5.010' ) {
require re;
re->import('regexp_pattern');
}
#pod =method connect
#pod
#pod $client = MongoDB->connect(); # localhost, port 27107
#pod $client = MongoDB->connect($host_uri);
#pod $client = MongoDB->connect($host_uri, $options);
#pod
#pod This function returns a L<MongoDB::MongoClient> object. The first parameter is
#pod used as the C<host> argument and must be a host name or L<connection string
#pod URI|MongoDB::MongoClient/CONNECTION STRING URI>. The second argument is
#pod optional. If provided, it must be a hash reference of constructor arguments
#pod for L<MongoDB::MongoClient::new|MongoDB::MongoClient/ATTRIBUTES>.
#pod
#pod If an error occurs, a L<MongoDB::Error> object will be thrown.
#pod
#pod B<NOTE>: To connect to a replica set, a replica set name must be provided.
#pod For example, if the set name is "setA":
#pod
#pod $client = MongoDB->connect("mongodb://example.com/?replicaSet=setA");
#pod
#pod =cut
sub connect {
my ($class, $host, $options) = @_;
$host ||= "mongodb://localhost";
$options ||= {};
$options->{host} = $host;
return MongoDB::MongoClient->new( $options );
}
sub force_double {
if ( ref $_[0] ) {
Carp::croak("Can't force a reference into a double");
}
return $_[0] = unpack("d",pack("d", $_[0]));
}
sub force_int {
if ( ref $_[0] ) {
Carp::croak("Can't force a reference into an int");
}
return $_[0] = int($_[0]);
}
1;
=pod
=encoding UTF-8
=head1 NAME
MongoDB - Official MongoDB Driver for Perl
=head1 VERSION
version v1.8.1
=head1 SYNOPSIS
use MongoDB;
my $client = MongoDB->connect('mongodb://localhost');
my $collection = $client->ns('foo.bar'); # database foo, collection bar
my $result = $collection->insert_one({ some => 'data' });
my $data = $collection->find_one({ _id => $result->inserted_id });
=head1 DESCRIPTION
This is the official Perl driver for L<MongoDB|http://www.mongodb.com>.
MongoDB is an open-source document database that provides high performance,
high availability, and easy scalability.
A MongoDB server (or multi-server deployment) hosts a number of databases. A
database holds a set of collections. A collection holds a set of documents. A
document is a set of key-value pairs. Documents have dynamic schema. Using dynamic
schema means that documents in the same collection do not need to have the same
set of fields or structure, and common fields in a collection's documents may
hold different types of data.
Here are some resources for learning more about MongoDB:
=over 4
=item *
L<MongoDB Manual|http://docs.mongodb.org/manual/contents/>
=item *
L<MongoDB CRUD Introduction|http://docs.mongodb.org/manual/core/crud-introduction/>
=item *
L<MongoDB Data Modeling Introductions|http://docs.mongodb.org/manual/core/data-modeling-introduction/>
=back
To get started with the Perl driver, see these pages:
=over 4
=item *
L<MongoDB Perl Driver Tutorial|MongoDB::Tutorial>
=item *
L<MongoDB Perl Driver Examples|MongoDB::Examples>
=back
Extensive documentation and support resources are available via the
L<MongoDB community website|http://www.mongodb.org/>.
=head1 USAGE
The MongoDB driver is organized into a set of classes representing different
levels of abstraction and functionality.
As a user, you first create and configure a L<MongoDB::MongoClient> object to
connect to a MongoDB deployment. From that client object, you can get
a L<MongoDB::Database> object for interacting with a specific database.
From a database object, you can get a L<MongoDB::Collection> object for CRUD
operations on that specific collection, or a L<MongoDB::GridFS> object for
working with an abstract file system hosted on the database. Each of those
classes may return other objects for specific features or functions.
See the documentation of those classes for more details or the
L<MongoDB Perl Driver Tutorial|MongoDB::Tutorial> for an example.
=head2 Error handling
Unless otherwise documented, errors result in fatal exceptions. See
L<MongoDB::Error> for a list of exception classes and error code
constants.
=head1 METHODS
=head2 connect
$client = MongoDB->connect(); # localhost, port 27107
$client = MongoDB->connect($host_uri);
$client = MongoDB->connect($host_uri, $options);
This function returns a L<MongoDB::MongoClient> object. The first parameter is
used as the C<host> argument and must be a host name or L<connection string
URI|MongoDB::MongoClient/CONNECTION STRING URI>. The second argument is
optional. If provided, it must be a hash reference of constructor arguments
for L<MongoDB::MongoClient::new|MongoDB::MongoClient/ATTRIBUTES>.
If an error occurs, a L<MongoDB::Error> object will be thrown.
B<NOTE>: To connect to a replica set, a replica set name must be provided.
For example, if the set name is "setA":
$client = MongoDB->connect("mongodb://example.com/?replicaSet=setA");
=for Pod::Coverage force_double
force_int
read_documents
=head1 SEMANTIC VERSIONING SCHEME
Starting with MongoDB C<v1.0.0>, the driver reverts to the more familiar
three-part version-tuple numbering scheme used by both Perl and MongoDB:
C<vX.Y.Z>
=over 4
=item *
C<X> will be incremented for incompatible API changes.
=item *
Even-value increments of C<Y> indicate stable releases with new functionality. C<Z> will be incremented for bug fixes.
=item *
Odd-value increments of C<Y> indicate unstable ("development") releases that should not be used in production. C<Z> increments have no semantic meaning; they indicate only successive development releases.
=back
See the Changes file included with releases for an indication of the nature of
changes involved.
=head1 ENVIRONMENT VARIABLES
If the C<PERL_MONGO_WITH_ASSERTS> environment variable is true before the
MongoDB module is loaded, then its various classes will be generated with
internal type assertions enabled. This has a severe performance cost and
is not recommended for production use. It may be useful in diagnosing
bugs.
If the C<PERL_MONGO_NO_DEP_WARNINGS> environment variable is true, then
deprecated methods will not issue warnings when used. (Normally, a
deprecation warning is issued once per call-site for deprecated methods.)
=head1 THREADS
Because of well-known bugs, use of threads on perls before v5.8.5 is
not supported.
=for :stopwords cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
=head1 SUPPORT
=head2 Bugs / Feature Requests
Please report any bugs or feature requests through the issue tracker at L<https://jira.mongodb.org/browse/PERL>. You will be notified automatically of any progress on your issue.
=head2 Source Code
This is open source software. The code repository is available for public review and contribution under the terms of the license.
L<https://github.com/mongodb/mongo-perl-driver>
git clone https://github.com/mongodb/mongo-perl-driver.git
=head1 AUTHORS
=over 4
=item *
David Golden <david@mongodb.com>
=item *
Rassi <rassi@mongodb.com>
=item *
Mike Friedman <friedo@friedo.com>
=item *
Kristina Chodorow <k.chodorow@gmail.com>
=item *
Florian Ragwitz <rafl@debian.org>
=back
=head1 CONTRIBUTORS
=for stopwords Andrew Page Andrey Khozov Ashley Willis Ask Bjørn Hansen Bernard Gorman Brendan W. McAdams Casey Rojas Christian Sturm Walde Colin Cyr Danny Raetzsch David Morrison Nadle Steinbrunner Storch diegok D. Ilmari Mannsåker Eric Daniels Gerard Goossen Glenn Fowler Graham Barr Hao Wu Jason Carey Toffaletti Johann Rolschewski John A. Kunze Joseph Harnish Josh Matthews Joshua Juran J. Stewart Kamil Slowikowski Ken Williams Matthew Shopsin Michael Langner Rotmanov Mike Dirolf Mohammad S Anwar Nickola Trupcheff Nigel Gregoire Niko Tyni Nuno Carvalho Orlando Vazquez Othello Maurer Pan Fan Pavel Denisov Rahul Dhodapkar Robin Lee Roman Yerin Ronald J Kimball Ryan Chipman Slaven Rezic Stephen Oberholtzer Steve Sanbeg Stuart Watt Uwe Voelker Whitney Jackson Xtreak Zhihong Zhang
=over 4
=item *
Andrew Page <andrew@infosiftr.com>
=item *
Andrey Khozov <avkhozov@gmail.com>
=item *
Ashley Willis <ashleyw@cpan.org>
=item *
Ask Bjørn Hansen <ask@develooper.com>
=item *
Bernard Gorman <bernard.gorman@mongodb.com>
=item *
Brendan W. McAdams <brendan@mongodb.com>
=item *
Casey Rojas <casey.j.rojas@gmail.com>
=item *
Christian Hansen <chansen@cpan.org>
=item *
Christian Sturm <kind@gmx.at>
=item *
Christian Walde <walde.christian@googlemail.com>
=item *
Colin Cyr <ccyr@sailingyyc.com>
=item *
Danny Raetzsch <danny@paperskymedia.com>
=item *
David Morrison <dmorrison@venda.com>
=item *
David Nadle <david@nadle.com>
=item *
David Steinbrunner <dsteinbrunner@pobox.com>
=item *
David Storch <david.storch@mongodb.com>
=item *
diegok <diego@freekeylabs.com>
=item *
D. Ilmari Mannsåker <ilmari.mannsaker@net-a-porter.com>
=item *
Eric Daniels <eric.daniels@mongodb.com>
=item *
Gerard Goossen <gerard@ggoossen.net>
=item *
Glenn Fowler <cebjyre@cpan.org>
=item *
Graham Barr <gbarr@pobox.com>
=item *
Hao Wu <echowuhao@gmail.com>
=item *
Jason Carey <jason.carey@mongodb.com>
=item *
Jason Toffaletti <jason@topsy.com>
=item *
Johann Rolschewski <rolschewski@gmail.com>
=item *
John A. Kunze <jak@ucop.edu>
=item *
Joseph Harnish <bigjoe1008@gmail.com>
=item *
Josh Matthews <joshua.matthews@mongodb.com>
=item *
Joshua Juran <jjuran@metamage.com>
=item *
J. Stewart <jstewart@langley.theshire>
=item *
Kamil Slowikowski <kslowikowski@gmail.com>
=item *
Ken Williams <kwilliams@cpan.org>
=item *
Matthew Shopsin <matt.shopsin@mongodb.com>
=item *
Michael Langner <langner@fch.de>
=item *
Michael Rotmanov <rotmanov@sipgate.de>
=item *
Mike Dirolf <mike@mongodb.com>
=item *
Mohammad S Anwar <mohammad.anwar@yahoo.com>
=item *
Nickola Trupcheff <n.trupcheff@gmail.com>
=item *
Nigel Gregoire <nigelg@airg.com>
=item *
Niko Tyni <ntyni@debian.org>
=item *
Nuno Carvalho <mestre.smash@gmail.com>
=item *
Orlando Vazquez <ovazquez@gmail.com>
=item *
Othello Maurer <omaurer@venda.com>
=item *
Pan Fan <nightsailer@gmail.com>
=item *
Pavel Denisov <pavel.a.denisov@gmail.com>
=item *
Rahul Dhodapkar <rahul@mongodb.com>
=item *
Robin Lee <cheeselee@fedoraproject.org>
=item *
Roman Yerin <kid@cpan.org>
=item *
Ronald J Kimball <rkimball@pangeamedia.com>
=item *
Ryan Chipman <ryan@ryanchipman.com>
=item *
Slaven Rezic <slaven.rezic@idealo.de>
=item *
Stephen Oberholtzer <stevie@qrpff.net>
=item *
Steve Sanbeg <stevesanbeg@buzzfeed.com>
=item *
Stuart Watt <stuart@morungos.com>
=item *
Uwe Voelker <uwe.voelker@xing.com>
=item *
Whitney Jackson <whjackson@gmail.com>
=item *
Xtreak <tirkarthi@users.noreply.github.com>
=item *
Zhihong Zhang <zzh_621@yahoo.com>
=back
=head1 COPYRIGHT AND LICENSE
This software is Copyright (c) 2018 by MongoDB, Inc.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
=cut
__END__
# vim: set ts=4 sts=4 sw=4 et tw=75:
|