MongoDB\BSON\Document::has

(mongodb >=1.16.0)

MongoDB\BSON\Document::hasReturns whether a key is present in the document

Description

final public MongoDB\BSON\Document::has(string $key): bool

Liste de paramètres

key (string)

The key to look for in the document.

Valeurs de retour

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

Erreurs / Exceptions

  • Lance une exception MongoDB\Driver\InvalidArgumentException lors d'une erreur survenue pendant l'analyse d'un argument.

Voir aussi

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top