MongoDB\BSON\Document::offsetExists

Returns whether a key is present in the document

Description

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

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