php8.5
Home/ Manual/ bson / document/ MongoDB\BSON\Document::offsetSet

MongoDB\BSON\Document::offsetSet

PHP function Edit on GitHub ✎

(mongodb >=1.17.0)

Implementation of ArrayAccess

Description

MongoDB\BSON\Document::offsetSet(mixed $key, mixed $value): void

Sets the value at the specified key to value.

Parameters

key

The index being set.

value

The new value for the key.

Return Values

Void

Errors/Exceptions

  • Always throws a MongoDB\Driver\Exception\LogicException.

Source: reference/mongodb/bson/document/offsetset.xml · from the official PHP manual (php/doc-en)