MongoD...Result(3pm)

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

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

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