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

MongoDB\BSON\Document::offsetExists

PHP function Edit on GitHub ✎

(mongodb >=1.17.0)

Returns whether a key is present in the document

Description

MongoDB\BSON\Document::offsetExists(mixed $key): bool

Parameters

key

The key to look for in the document.

Return Values

Returns true if the key is present in the document and false otherwise.

See Also

  • ArrayAccess::offsetExists
  • MongoDB\BSON\Document::has

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