Provided by: libmongoc-doc_2.2.1-1_all bug

SYNOPSIS

          bool
          mongoc_error_has_label (const bson_t *reply, const char *label);

       Test  whether  a  reply  from  a  failed  operation  includes a specific error label. See Error Labels <#
       error-labels> for details, and see mongoc_client_session_start_transaction() <>  for  example  code  that
       demonstrates their use.

PARAMETERS

reply:  A  non-NULL pointer to overwritable storage <https://www.mongodb.com/docs/languages/c/c-driver/
         current/libbson/guides/lifetimes/#overwritable-storage> for a  bson_t  <https://www.mongoc.org/libbson/
         current/bson_t.html> to contain the results.

       • label: The label to test for, such as "TransientTransactionError" or "UnknownTransactionCommitResult".

RETURNS

       Returns true if reply contains the error label.

Author

       MongoDB, Inc

Copyright

       2009-present, MongoDB, Inc.

2.2.1                                             Dec 11, 2025                         MONGOC_ERROR_HAS_LABEL(3)