MongoD...eResult(3pm)
β¨ 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>
π 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
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
- 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