MongoD...eResult(3pm)

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

✨ MongoDB::DeleteResult β€” the receipts for when you delete stuff πŸ’…

okay bestie, so this is a page from the User Contributed Perl Documentation manual, and it's all about MongoDB::DeleteResult πŸ—‘οΈβœ¨ It's literally the little object you get handed back after a delete operation so you can peek at what actually went down. Not me being obsessed with a result object but here we are.

VERSION β€” this one's rockin' version v2.2.2 πŸŽ€


🌸 SYNOPSIS 🌸

my $result = $coll->delete_one( { _id => $oid } );

if ( $result->acknowledged ) {
    ...
}

like… you delete one thing with a filter, and then you check if the write was acknowledged before you do anything else. gatekeeping? no. slaying? yes. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

This class encapsulates the results from a deletion operation.

that's it, that's the whole vibe β€” it's the wrapper that holds all the deets about how your delete went down. no cap. 🫢


πŸ’œ ATTRIBUTES πŸ’œ

🌈 deleted_count

The number of documents that matched the filter. πŸ”’ so if your filter matched a bunch of docs, this is the number that tells you. iconic.


✨ METHODS ✨

πŸŽ€ acknowledged

Indicates whether this write result was acknowledged. Always true for this class. so like… it's giving permanently-yes energy. every single time. πŸ’–

πŸ“ assert

Throws an error if write errors or write concern errors occurred. Otherwise, returns the invocant.

so it's the "bestie please double check nothing went wrong" method β€” anything sus happens and it throws. otherwise it just hands you back the invocant like nothing happened. cute. 😭

🧚 assert_no_write_error

Throws a MongoDB::WriteError if write errors occurred. Otherwise, returns the invocant.

same energy, but specifically checking for write errors, and the error it throws is a MongoDB::WriteError. 🚨

πŸ‘‘ assert_no_write_concern_error

Throws a MongoDB::WriteConcernError if write concern errors occurred. Otherwise, returns the invocant.

and this one's the write concern error detector, throwing a MongoDB::WriteConcernError. different error class, different drama, same "otherwise returns the invocant" ending. ✨


πŸ’… AUTHORS πŸ’…

the literal icons who made this happen ✨

  • 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. πŸ“…

This is free software, licensed under:

The Apache License, Version 2.0, January 2004

free software, Apache-2.0, the whole legal serve. read it, respect it, periodt. πŸ’–


okay that's the whole page bestie, every option, every method, every name β€” nothing skipped, nothing invented 🫢

sign-off szn πŸ¦‹ this lil page came from perl v5.40.1 and got stamped 2025-04-03, filed under MongoD…eResult(3pm) because terminal columns said "we're cutting you off mid-word, girl." πŸ’€ mwah, go delete responsibly ✨

πŸ“¦ where this page comes from