mysql_xdevapi\CollectionModify
PHP Manual

CollectionModify::replace

(No version information available, might only be in Git)

CollectionModify::replaceReplace document field

说明

public mysql_xdevapi\CollectionModify mysql_xdevapi\CollectionModify::replace ( string $collection_field , string $expression_or_literal )

Replace (update) a given field value with a new one.

Warning

本函数还未编写文档,仅有参数列表。

参数

collection_field

The document path of the item to set.

expression_or_literal

The value to set on the specified attribute.

返回值

A CollectionModify object.

范例

Example #1 mysql_xdevapi\CollectionModify::replace() example

<?php

$res 
$data $obj->sort(['_id desc'])->limit(2)->replace('job''Disoccupato')->execute();

?>

mysql_xdevapi\CollectionModify
PHP Manual