MongoD...yResult(3pm)

πŸ“¦
version 2.2.2 Β· 5 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– 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. 🌟


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