array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'mysql-xdevapi-collectionmodify.unset.php', 1 => 'CollectionModify::unset', 2 => 'Unset the value of document fields', ), 'up' => array ( 0 => 'class.mysql-xdevapi-collectionmodify.php', 1 => 'mysql_xdevapi\\CollectionModify', ), 'prev' => array ( 0 => 'mysql-xdevapi-collectionmodify.sort.php', 1 => 'CollectionModify::sort', ), 'next' => array ( 0 => 'class.mysql-xdevapi-collectionremove.php', 1 => 'mysql_xdevapi\\CollectionRemove', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mysql_xdevapi/mysql_xdevapi/collectionmodify/unset.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(No version information available, might only be in Git)
CollectionModify::unset — Unset the value of document fields
Removes attributes from documents in a collection.
fieldsThe attributes to remove from documents in a collection.
CollectionModify object that can be used for further processing.
示例 #1 mysql_xdevapi\CollectionModify::unset() example
<?php
$res = $coll->modify('job like :job_name')->unset(["age", "name"])->bind(['job_name' => 'Plumber'])->execute();
?>