Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<MongoDB\Driver\TopologyDescription::hasWritableServerMongoDB\Driver\WriteConcernError::getCode>
^MongoDB\DriverLast updated: Mon, 26 Oct 2026

The MongoDB\Driver\WriteConcernError class

(mongodb >=1.0.0)

Introduction

The MongoDB\Driver\WriteConcernError class encapsulates information about a write concern error and may be returned by MongoDB\Driver\WriteResult::getWriteConcernError().

Class synopsis

final class MongoDB\Driver\WriteConcernError {
/* Properties */
public readonly string $message;
public readonly int $code;
public readonly ?object $info;
/* Methods */
final public function getCode(): int
final public function getInfo(): ?object
final public function getMessage(): string
}

Properties

message

The error message.

code

The error code.

info

Additional information for the error, or null if not available.

Changelog

Version Description
PECL mongodb 2.3.0 Added public readonly properties.

Table of Contents


<MongoDB\Driver\TopologyDescription::hasWritableServerMongoDB\Driver\WriteConcernError::getCode>
^MongoDB\DriverLast updated: Mon, 26 Oct 2026