MongoDB\BSON\Document::has

(mongodb >=1.16.0)

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

Description

finalpublicMongoDB\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

To Top