MongoD...eResult(3pm)
β¨ MongoDB::UpdateResult β the whole vibe β¨
okay bestie, so this is a page from the User Contributed Perl Documentation (yes, that's the manual name, we're folding it in like a lil garnish π
), and it's all about MongoDB::UpdateResult β the little receipt object you get handed back after an update or a replace.
π VERSION π
version v2.2.2 β that's the one, no cap.
πΈ SYNOPSIS πΈ
like, here's the whole thing in action:
my $result = $coll->update( @parameters );
if ( $result->acknowledged ) {
...
}
that's it. that's the vibe check. β¨
π¦ DESCRIPTION π¦
bestie listen. This class is literally just a lil container that encapsulates the results from an update or replace operations. That's its whole personality. It holds the receipts from your write, and you poke at it to find out what actually went down. π«Ά
π ATTRIBUTES π
π matched_count
The number of documents that matched the filter. simple as that, she's counting who showed up to the party. π
β¨ modified_count
The number of documents that were modified.
β οΈ okay IMPORTANT bestie: this is only available from MongoDB version 2.6 or later. It will return "undef" from earlier servers. so if you're on an ancient server she is simply not going to tell you anything. π
You can call "has_modified_count" to find out if this attribute is defined or not β that's your little vibe check for whether the number is even there. π₯
π§ upserted_id
The identifier of the inserted document if an upsert took place. If no upsert took place, it returns "undef".
so like: upsert happened? here's the id, queen π. no upsert? undef, nothing to see here, moving on. π
π METHODS π
β acknowledged
Indicates whether this write result was acknowledged. Always true for this class. always. every time. she is nothing if not consistent. periodt. π
πΈ assert
Throws an error if write errors or write concern errors occurred. Otherwise, returns the invocant.
like, she will absolutely make a scene if something went wrong π but if everything's fine, she just hands you back the invocant like nothing happened. iconic.
π¦ assert_no_write_error
Throws a MongoDB::WriteError if write errors occurred. Otherwise, returns the invocant. π
π assert_no_write_concern_error
Throws a MongoDB::WriteConcernError if write concern errors occurred. Otherwise, returns the invocant. π«Ά
π AUTHORS π
the literal legends responsible for this, in order:
- 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>
π 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
and that's the whole page bestie, no notes. π β¨
generated by perl v5.40.1 on 2025-04-03 β mwah, love u, go forth and update 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