MongoD...yResult(3pm)
π MongoDB::InsertManyResult π
okay bestie, so this little guy is a MongoDB::InsertManyResult β a MongoDB single insert result object. and yes we're reading the User Contributed Perl Documentation manual page for it, which is version v2.2.2. it's giving "small class, big feelings," fr fr. π
β¨ NAME β¨
MongoDB::InsertManyResult β MongoDB single insert result object. that's the whole name, she's lowkey self-explanatory and we love that for her. π
πΈ VERSION πΈ
version v2.2.2
π¦ SYNOPSIS π¦
here's the vibe, copy-paste ready:
my $result = $coll->insert( $document );
if ( $result->acknowledged ) {
...
}
see how she's checking acknowledged before doing literally anything else? that's the move. β¨
π DESCRIPTION π
so this class encapsulates the result from the insertion of a single document. that's it, that's the whole description, she said what she said. no cap. π«Ά
π ATTRIBUTES π
π inserted_count
the number of documents inserted. a whole count. iconic. π’
π inserted
an array reference containing information about inserted documents (if any). Documents are just as in "upserted". so if you've met upserted before, you already know her sister. π
π§ inserted_ids
a hash reference built lazily from "inserted", mapping indexes to object IDs. lazy in the "doesn't do the work until you need it" way, not the "won't text back" way. π
π₯ METHODS π₯
π acknowledged
indicates whether this write result was acknowledged. Always true for this class. yes, always. she's a steady queen, no plot twists. π
β¨ assert
throws an error if write errors or write concern errors occurred. otherwise, returns the invocant. so: she'll yell if something's wrong, and if not, she just hands you back yourself. fair deal. π«Ά
πΈ assert_no_write_error
throws a MongoDB::WriteError if write errors occurred. otherwise, returns the invocant. bestie who checks in, then goes back to vibing.
π assert_no_write_concern_error
throws a MongoDB::WriteConcernError if write concern errors occurred. otherwise, returns the invocant. same energy, different error class, iykyk.
π AUTHORS π
the legends who built her:
- David Golden <david@mongodb.com>
- Rassi <rassi@mongodb.com>
- Mike Friedman <friedo@friedo.com>
- Kristina Chodorow <k.chodorow@gmail.com>
- Florian Ragwitz <rafl@debian.org>
five whole icons. group project that actually worked, we love to see it. π
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2020 by MongoDB, Inc.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
β οΈ legal bestie moment: it's free software, but it's licensed β read the license, don't just assume. π«Ά
aaaand that's the whole page, no skips, no summaries, every last detail accounted for. π
this manual came to you via perl v5.40.1 and it's dated 2025-04-03, so if your perldoc is built on something else, that's the version stamp you're looking at. mwah, go insert some documents responsibly. πβ¨
π¦ where this page comes from
- debian trixie: libmongodb-perl 2.2.2-3 Β· Apache-2.0
- ubuntu resolute: libmongodb-perl 2.2.2-3 Β· Apache-2.0
- ubuntu stonking: libmongodb-perl 2.2.2-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms