MongoD...Result(3pm)
π MongoDB::CommandResult π
okay so bestie, this is the manual page for MongoDB::CommandResult β a lil Perl module that lives in the User Contributed Perl Documentation section (that's the 3pm part, iykyk). Buckle up, it's short but it's cute. π
β¨ NAME β¨
MongoDB::CommandResult β the MongoDB generic command result document. it's giving "here's what the database said back" energy. π¦
πΈ VERSION πΈ
version v2.2.2 β that's the one we're on, no cap.
π DESCRIPTION π
so basically this class encapsulates the results from a database command. think of it as the fancy little gift box π that holds whatever the command handed back.
and here's the tea: right now, it is only available from the "result" attribute of "MongoDB::DatabaseError". that's it. that's the only way in. periodt.
π ATTRIBUTES π
output
a hash reference with the output document of a database command. the actual data payload, the main character of the whole thing. β¨
address
the address ("host:port") of the server that ran the command. gotta know who did the work. π
session
the ClientSession which the command was ran with, if any. if there wasn't one, well, there just isn't one. π
π₯ METHODS π₯
last_code
the error code (if any) or 0 if there was no error. zero means we're chill. π
last_errmsg
the error string (if any) or the empty string if there was no error. empty string = no drama. π§
last_wtimeout
true if a write concern error or timeout occurred, or false otherwise. a lil yes/no vibe check. π
last_error_labels
returns an array of error labels from the command, or an empty array if there are none. no labels? you get an empty array, not nothing. be grateful. π
assert
throws an exception if the command failed. it's the "did this actually work or are we lying to ourselves" check. π
assert_no_write_concern_error
throws an exception if a write concern error occurred. same energy, but specifically about write concern. π
π«Ά AUTHORS π«Ά
look at this iconic lineup, absolute legends fr fr:
- 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.
it's free software, licensed under:
The Apache License, Version 2.0, January 2004
and that's the whole page bestie!! π this was MongoDB::CommandResult from the Perl v5.40.1 docs, dated 2025-04-03, written up in User Contributed Perl Documentation. go forth and command 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