array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'mongodb-bson-document.has.php', 1 => 'MongoDB\\BSON\\Document::has', 2 => 'Returns whether a key is present in the document', ), 'up' => array ( 0 => 'class.mongodb-bson-document.php', 1 => 'MongoDB\\BSON\\Document', ), 'prev' => array ( 0 => 'mongodb-bson-document.getiterator.php', 1 => 'MongoDB\\BSON\\Document::getIterator', ), 'next' => array ( 0 => 'mongodb-bson-document.offsetexists.php', 1 => 'MongoDB\\BSON\\Document::offsetExists', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mongodb/bson/document/has.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

MongoDB\BSON\Document::has

(mongodb >=1.16.0)

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

说明

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

参数

key (string)

The key to look for in the document.

返回值

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

错误/异常

参见